Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow logging models from GenericLogger #8676

Merged
merged 64 commits into from
Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
ea2a60a
enhance
AyushExel Jun 13, 2022
2c00374
Merge branch 'classifier' of https://github.com/AyushExel/yolov5 into…
AyushExel Jun 13, 2022
16f1fab
revert
AyushExel Jun 20, 2022
5f7209c
allow training from scratch
AyushExel Jun 20, 2022
94bd25a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 20, 2022
05057aa
Update --img argument from train.py
glenn-jocher Jun 20, 2022
b72d6de
fix image size from 640 to 128
glenn-jocher Jun 20, 2022
92d7821
Merge branch 'ultralytics:classifier' into classifier
AyushExel Jun 21, 2022
f7f07da
suport custom dataloader and augmentation
AyushExel Jun 21, 2022
d01b88d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 22, 2022
ab534a8
format
AyushExel Jun 22, 2022
25fd4be
Merge branch 'classifier' of https://github.com/AyushExel/yolov5 into…
AyushExel Jun 22, 2022
42277e2
Update dataloaders.py
AyushExel Jun 23, 2022
b12eb54
Single line return, single line comment, remove unused argument
glenn-jocher Jun 26, 2022
264531a
address PR comments
AyushExel Jun 26, 2022
6bd2d25
Merge branch 'classifier' of https://github.com/AyushExel/yolov5 into…
AyushExel Jun 26, 2022
7d53574
fix spelling
AyushExel Jun 26, 2022
8e42374
don't augment eval set
AyushExel Jun 26, 2022
b8ed832
use fstring
glenn-jocher Jun 26, 2022
61fafc4
update augmentations.py
glenn-jocher Jun 26, 2022
22af200
new maning convention for transforms
AyushExel Jun 26, 2022
ac22de3
reverse if statement, inline ops
glenn-jocher Jun 26, 2022
e54a038
Merge remote-tracking branch 'origin/classifier' into classifier
glenn-jocher Jun 26, 2022
19f45fc
reverse if statement, inline ops
glenn-jocher Jun 26, 2022
6beb9d9
updates
glenn-jocher Jun 26, 2022
10fe6b7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 26, 2022
218c951
update dataloaders
AyushExel Jun 26, 2022
d238c91
Remove additional if statement
glenn-jocher Jun 26, 2022
5a58efd
Merge remote-tracking branch 'origin/classifier' into classifier
glenn-jocher Jun 26, 2022
92c2b8b
Remove is_train as redundant
glenn-jocher Jun 26, 2022
7d5f091
Cleanup
glenn-jocher Jun 26, 2022
740231a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 26, 2022
82e902e
Cleanup2
glenn-jocher Jun 26, 2022
b76dd41
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 26, 2022
72fc0a0
Update classifier.py
glenn-jocher Jun 26, 2022
8bcfbd9
Merge branch 'classifier' of https://github.com/AyushExel/yolov5 into…
AyushExel Jun 26, 2022
82b178d
Update augmentations.py
glenn-jocher Jun 26, 2022
893c1ee
fix: imshow clip warning
AyushExel Jun 26, 2022
4f5939f
Merge branch 'classifier' of https://github.com/AyushExel/yolov5 into…
AyushExel Jun 26, 2022
ad3b635
update
AyushExel Jun 26, 2022
b0d24e7
Revert ToTensorV2 removal
glenn-jocher Jun 26, 2022
bfc17c5
Update classifier.py
glenn-jocher Jun 26, 2022
6b44c8e
Update normalize values, revert uint8
glenn-jocher Jun 26, 2022
8389a3b
normalize image using cv2
AyushExel Jun 26, 2022
69b79cb
normalize img using cv2
AyushExel Jun 26, 2022
320629c
remove dedundant comment
AyushExel Jun 26, 2022
77f7c71
Update classifier.py
glenn-jocher Jun 26, 2022
c2c9f97
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 26, 2022
82607c3
Merge branch 'ultralytics:classifier' into classifier
AyushExel Jun 27, 2022
85a84a4
replace print with logger
AyushExel Jun 27, 2022
0cda4ee
Merge branch 'classifier' of https://github.com/ultralytics/yolov5 in…
AyushExel Jul 20, 2022
2db2311
commit steps
AyushExel Jul 20, 2022
1d17a30
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 20, 2022
d005533
Merge branch 'classifier' of https://github.com/ultralytics/yolov5 in…
AyushExel Jul 22, 2022
90b4b50
support final model logging
AyushExel Jul 22, 2022
bb15a94
update
AyushExel Jul 22, 2022
1b183ce
update
AyushExel Jul 22, 2022
60e5640
update
AyushExel Jul 22, 2022
17c5dc8
update
AyushExel Jul 22, 2022
a7205cf
Merge branch 'classifier' of https://github.com/ultralytics/yolov5 in…
AyushExel Jul 22, 2022
1db25db
remove curses
AyushExel Jul 22, 2022
e2dcc50
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 22, 2022
5135f75
Update classifier.py
glenn-jocher Jul 22, 2022
c82e6df
Update __init__.py
glenn-jocher Jul 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ def train():
images = images.to(device)
pred = torch.max(ema.ema(images), 1)[1]
file = imshow(denormalize(images), labels, pred, names, verbose=True, f=save_dir / 'test_images.jpg')
meta = {"epochs": epochs, "accuracy": best_fitness, "date": datetime.now().isoformat()}
logger.log_images(file, name='Test Examples (true-predicted)', epoch=epoch)
logger.log_model(best, epochs, metadata=meta)


@torch.no_grad()
Expand Down
7 changes: 7 additions & 0 deletions utils/loggers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,13 @@ def log_graph(self, model, imgsz=(640, 640)):
if self.tb:
log_tensorboard_graph(self.tb, model, imgsz)

def log_model(self, model_path, epoch=0, metadata={}):
# Log model to all loggers
if self.wandb:
art = wandb.Artifact(name=f"run_{wandb.run.id}_model", type="model", metadata=metadata)
art.add_file(str(model_path))
wandb.log_artifact(art)


def log_tensorboard_graph(tb, model, imgsz=(640, 640)):
# Log model graph to TensorBoard
Expand Down