Commit Graph
100 Commits
Author SHA1 Message Date
Glenn Jocher 1487bc84ff Update README.md 2021-04-12 13:27:40 +02:00
Glenn Jocher 860ca98832 Created using Colaboratory 2021-04-12 13:10:08 +02:00
Glenn Jocher cac8a765c8 Created using Colaboratory 2021-04-12 13:02:40 +02:00
Glenn Jocher 2eab46e2cf Update tutorial.ipynb 2021-04-12 12:33:04 +02:00
Glenn Jocher 6b718e9127 Created using Colaboratory 2021-04-12 12:31:28 +02:00
Glenn Jocher 54d65160b7 Update tutorial.ipynb 2021-04-12 12:26:28 +02:00
Glenn Jocher 0f395b3e3b YOLOv5 v5.0 Release patch 1 (#2764)
* torch.jit.trace(model, img, strict=False)

* Update check_file()

* Update hubconf.py

* Update README.md
2021-04-11 23:11:43 +02:00
Glenn Jocher f5b8f7d54c YOLOv5 v5.0 Release (#2762) 2021-04-11 19:23:47 +02:00
Glenn Jocher 9029759cb3 Created using Colaboratory 2021-04-11 16:28:32 +02:00
Glenn Jocher 6dd1083bbb Tensorboard model visualization bug fix (#2758)
This fix should allow for visualizing YOLOv5 model graphs correctly in Tensorboard by uncommenting line 335 in train.py:
```python
                    if tb_writer:
                        tb_writer.add_graph(torch.jit.trace(model, imgs, strict=False), [])  # add model graph
```

The problem was that the detect() layer checks the input size to adapt the grid if required, and tracing does not seem to like this shape check (even if the shape is fine and no grid recomputation is required). The following will warn:
https://github.com/ultralytics/yolov5/blob/0cae7576a9241110157cd154fc2237e703c2719e/train.py#L335

Solution is below. This is a YOLOv5s model displayed in TensorBoard. You can see the Detect() layer merging the 3 layers into a single output for example, and everything appears to work and visualize correctly.
```python
tb_writer.add_graph(torch.jit.trace(model, imgs, strict=False), [])
```
<img width="893" alt="Screenshot 2021-04-11 at 01 10 09" src="https://user-images.githubusercontent.com/26833433/114286928-349bd600-9a63-11eb-941f-7139ee6cd602.png">
2021-04-11 01:33:55 +02:00
Glenn Jocher 0cae7576a9 utils/wandb_logging PEP8 reformat (#2755)
* wandb_logging PEP8 reformat

* Update wandb_utils.py
2021-04-10 21:09:23 +02:00
Glenn Jocher b5de52c4cd torch.cuda.amp bug fix (#2750)
PR https://github.com/ultralytics/yolov5/pull/2725 introduced a very specific bug that only affects multi-GPU trainings. Apparently the cause was using the torch.cuda.amp decorator in the autoShape forward method. I've implemented amp more traditionally in this PR, and the bug is resolved.
2021-04-09 18:19:49 +02:00
Glenn Jocher fca5e2a48f autocast enable=torch.cuda.is_available() (#2748) 2021-04-09 13:34:49 +02:00
Glenn Jocher c03d590320 Add Hub results.pandas() method (#2725)
* Add Hub results.pandas() method

New method converts results from torch tensors to pandas DataFrames with column names.

This PR may partially resolve issue https://github.com/ultralytics/yolov5/issues/2703

```python
results = model(imgs)

print(results.pandas().xyxy[0])
         xmin        ymin        xmax        ymax  confidence  class    name
0   57.068970  391.770599  241.383545  905.797852    0.868964      0  person
1  667.661255  399.303589  810.000000  881.396667    0.851888      0  person
2  222.878387  414.774231  343.804474  857.825073    0.838376      0  person
3    4.205386  234.447678  803.739136  750.023376    0.658006      5     bus
4    0.000000  550.596008   76.681190  878.669922    0.450596      0  person
```

* Update comments 

torch example input now shown resized to size=640 and also now a multiple of P6 stride 64 (see https://github.com/ultralytics/yolov5/issues/2722#issuecomment-814785930)

* apply decorators

* PEP8

* Update common.py

* pd.options.display.max_columns = 10

* Update common.py
2021-04-07 16:28:07 +02:00
Glenn Jocher c8c8da6079 Update README with collapsable notes (#2721)
* Update README with collapsable notes.

* cleanup

* center table
2021-04-06 17:54:47 +02:00
Glenn Jocher ec8979f1d2 Updated filename attributes for YOLOv5 Hub BytesIO (#2718)
Fix 2 for 'Model predict with forward will fail if PIL image does not have filename attribute' #2702
2021-04-06 13:18:56 +02:00
Glenn Jocher 74276d5189 Updated filename attributes for YOLOv5 Hub results (#2708)
Proposed fix for 'Model predict with forward will fail if PIL image does not have filename attribute' #2702
2021-04-05 22:20:09 +02:00
Glenn Jocher 9ccfa85249 pip install coremltools onnx (#2690)
Requested in https://github.com/ultralytics/yolov5/issues/2686
2021-04-02 13:00:46 +02:00
Glenn Jocher 17300a4c7b autoShape forward im = np.asarray(im) # to numpy (#2689)
Slight speedup.
2021-04-02 12:36:38 +02:00
Glenn Jocher 2af059c0d8 PyTorch Hub model.save() increment as runs/hub/exp (#2684)
* PyTorch Hub model.save() increment as runs/hub/exp

This chane will align PyTorch Hub results saving with the existing unified results saving directory structure of

runs/
  /train
  /detect
  /test
  /hub
    /exp
    /exp2
    ...

* cleanup
2021-04-02 11:55:10 +02:00
Glenn Jocher b8b862993d Update README with Tips for Best Results tutorial (#2682)
* Update README with Tips for Best Results tutorial

* Update README.md
2021-04-01 15:01:00 +02:00
Glenn Jocher 877b826e3a Created using Colaboratory 2021-04-01 11:31:27 +02:00
Glenn Jocher 51cc0962b5 Update README.md 2021-04-01 11:16:56 +02:00
Glenn Jocher 1b475c1797 Created using Colaboratory 2021-03-30 20:07:18 +02:00
Glenn Jocher 1b100cd53e Created using Colaboratory (#2649) 2021-03-29 16:43:37 +02:00
Glenn Jocher 866bc7d640 Speed profiling improvements (#2648)
* Speed profiling improvements

* Update torch_utils.py

deepcopy() required to avoid adding elements to model.

* Update torch_utils.py
2021-03-29 15:19:07 +02:00
Glenn Jocher 2bf34f50fd PyTorch Hub amp.autocast() inference (#2641)
I think this should help speed up CUDA inference, as currently models may be running in FP32 inference mode on CUDA devices unnecesarily.
2021-03-28 20:23:40 +02:00
Glenn Jocher ee169834bd PyTorch Hub custom model to CUDA device fix (#2636)
Fix for #2630 raised by @Pro100rus32
2021-03-28 17:22:00 +02:00
Glenn Jocher 2e95cf3d79 Improve git_describe() fix 1 (#2635)
Add stderr=subprocess.STDOUT to catch error messages.
2021-03-28 17:09:06 +02:00
Glenn Jocher 6e8c5b7678 Improve git_describe() (#2633)
Catch 'fatal: not a git repository' returns and return '' instead (observed in GCP Hub checks).
2021-03-28 15:39:31 +02:00
Glenn Jocher 9b92d3ee76 FROM nvcr.io/nvidia/pytorch:21.03-py3 (#2623)
Update Docker FROM nvcr.io/nvidia/pytorch:21.03-py3
2021-03-27 18:35:53 +01:00
Glenn Jocher 2dfe32030a Remove conflicting nvidia-tensorboard package (#2622)
Attempt to resolve tensorboard Docker error in https://github.com/ultralytics/yolov5/issues/2573
2021-03-27 18:31:53 +01:00
Glenn Jocher 005d7a8c54 Update Detections() self.n comment (#2620)
```python
        self.n = len(self.pred)  # number of images (batch size)
```
2021-03-26 21:19:15 +01:00
Glenn Jocher a57f23d18b Update detections() self.t = tuple() (#2617)
* Update detections() self.t = tuple()

Fix multiple results.print() bug.

* Update experimental.py

* Update yolo.py
2021-03-26 13:23:11 +01:00
Glenn Jocher 0ff5aeca61 Create date_modified() (#2616)
Updated device selection string with fallback for non-git directories.
```python
def select_device(device='', batch_size=None):
    # device = 'cpu' or '0' or '0,1,2,3'
    s = f'YOLOv5 🚀 {git_describe() or date_modified()} torch {torch.__version__} '  # string
...
```
2021-03-26 12:52:47 +01:00
Glenn Jocher 77415a42e5 Update git_describe() for remote dir usage (#2606) 2021-03-26 01:44:00 +01:00
Glenn Jocher fca16dc4b3 Remove Cython from requirements.txt (#2604)
Cython should be a dependency of the remaining packages in requirements.txt, so should be installed anyway even if not a direct requirement.
2021-03-25 21:48:25 +01:00
Glenn Jocher 3bb414890a resume.py typo (#2603) 2021-03-25 20:55:20 +01:00
Glenn Jocher d4456e43b2 Update segment2box() comment (#2600) 2021-03-25 15:12:49 +01:00
Glenn Jocher ad05e37d99 Save webcam results, add --nosave option (#2598)
This updates the default detect.py behavior to automatically save all inference images/videos/webcams unless the new argument --nosave is used (python detect.py --nosave) or unless a list of streaming sources is passed (python detect.py --source streams.txt)
2021-03-25 14:09:49 +01:00
Glenn Jocher 333ccc5b0f YOLOv5 PyTorch Hub models >> check_requirements() (#2592)
Improved user-feedback following requirements auto-update.
2021-03-24 17:51:39 +01:00
Glenn Jocher 75feeb797c YOLOv5 PyTorch Hub models >> check_requirements() (#2591)
Prints 'Please restart runtime or rerun command for update to take effect.' following package auto-install to inform users to restart/rerun.
2021-03-24 16:42:54 +01:00
Glenn Jocher 8ace1b1b99 YOLOv5 PyTorch Hub models >> check_requirements() (#2588)
* YOLOv5 PyTorch Hub models >> check_requirements()

Update YOLOv5 PyTorch Hub requirements.txt path to cache path.

* Update hubconf.py
2021-03-24 16:23:54 +01:00
Glenn Jocher 9f98201dd9 W&B DDP fix 2 (#2587)
Revert unintentional change to test batch sizes caused by PR https://github.com/ultralytics/yolov5/pull/2125
2021-03-24 15:43:32 +01:00
Glenn Jocher 2bcc89d762 YOLOv5 PyTorch Hub models >> check_requirements() (#2577)
* Update hubconf.py with check_requirements()

Dependency checks have been missing from YOLOv5 PyTorch Hub model loading, causing errors in some cases when users are attempting to import hub models in unsupported environments. This should examine the YOLOv5 requirements.txt file and pip install any missing or version-conflict packages encountered. 

This is highly experimental (!), please let us know if this creates problems in your custom workflows.

* Update hubconf.py
2021-03-24 15:42:00 +01:00
Glenn Jocher e5b0200cd2 Update tensorboard>=2.4.1 (#2576)
* Update tensorboard>=2.4.1 

Update tensorboard version to attempt to address https://github.com/ultralytics/yolov5/issues/2573 (tensorboard logging fail in Docker image).

* cleanup
2021-03-24 01:29:00 +01:00
Glenn Jocher 2b329b0945 Enhanced check_requirements() with auto-install (#2575)
* Update check_requirements() with auto-install

This PR builds on an idea I had to automatically install missing dependencies rather than simply report an error message. 

YOLOv5 should now 1) display all dependency issues and not simply display the first missing dependency, and 2) attempt to install/update each missing/VersionConflict package.

* cleanup

* cleanup 2

* Check requirements.txt file exists

* cleanup 3
2021-03-24 01:05:59 +01:00
Glenn Jocher 0d891c601e check_requirements() exclude pycocotools, thop (#2571)
Exclude non-critical packages from dependency checks in detect.py. pycocotools and thop in particular are not required for inference.

Issue first raised in https://github.com/ultralytics/yolov5/issues/1944 and also raised in https://github.com/ultralytics/yolov5/discussions/2556
2021-03-23 14:25:55 +01:00
Glenn Jocher 1c132a1f94 Update Detections() times=None (#2570)
Fix for results.tolist() method breaking after YOLOv5 Hub profiling PRshttps://github.com/ultralytics/yolov5/pull/2460 https://github.com/ultralytics/yolov5/pull/2459 and
2021-03-23 14:10:47 +01:00
Glenn Jocher ed2c74218d Created using Colaboratory 2021-03-14 23:32:39 -07:00
Glenn Jocher 9b11f0c58b PyTorch Hub models default to CUDA:0 if available (#2472)
* PyTorch Hub models default to CUDA:0 if available

* device as string bug fix
2021-03-14 23:16:17 -07:00
Glenn Jocher 2d41e70e82 Scipy kmeans-robust autoanchor update (#2470)
Fix for https://github.com/ultralytics/yolov5/issues/2394
2021-03-14 21:58:12 -07:00
Glenn Jocher 6f718cee74 Created using Colaboratory 2021-03-13 20:20:09 -08:00
Glenn Jocher 20d879db36 Update tutorial.ipynb 2021-03-13 20:05:21 -08:00
Glenn Jocher f813f6dcc8 autoShape() speed profiling update (#2460) 2021-03-13 20:00:03 -08:00
Glenn Jocher 569757ecc0 Add autoShape() speed profiling (#2459)
* Add autoShape() speed profiling

* Update common.py

* Create README.md

* Update hubconf.py

* cleanuip
2021-03-13 19:50:34 -08:00
Glenn Jocher 747c2653ee CVPR 2021 Argoverse-HD autodownload curl (#2455)
curl preferred over wget for slightly better cross platform compatibility (i.e. out of the box macos compatible).
2021-03-12 22:27:53 -08:00
Glenn Jocher 08d4918d7f labels.jpg class names (#2454)
* labels.png class names

* fontsize=10
2021-03-12 22:15:41 -08:00
Glenn Jocher f4197214aa Update test.py --task train val study (#2453)
* Update test.py --task train val study

* update argparser --task
2021-03-12 22:08:42 -08:00
Glenn Jocher f01f3223d5 Integer printout (#2450)
* Integer printout

* test.py 'Labels'

* Update train.py
2021-03-12 13:35:44 -08:00
Glenn Jocher 886f1c03d8 DDP after autoanchor reorder (#2421) 2021-03-09 23:43:46 -08:00
Glenn Jocher d5ca8ca34e CVPR 2021 Argoverse-HD autodownload fix (#2418) 2021-03-09 21:07:27 -08:00
Glenn Jocher e8a2b83268 GCP sudo docker userdata.sh (#2393)
* GCP sudo docker

* cleanup
2021-03-07 20:21:49 -08:00
Glenn Jocher 7c2c95732c AWS wait && echo "All tasks done." (#2391) 2021-03-07 20:18:30 -08:00
Glenn Jocher ba18528b47 bbox_iou() stability and speed improvements (#2385) 2021-03-06 13:07:34 -08:00
Glenn Jocher c64fe219b4 ENV HOME=/usr/src/app (#2382)
Set HOME environment variable per Binder requirements. 
https://github.com/binder-examples/minimal-dockerfile
2021-03-05 15:53:57 -08:00
Glenn Jocher 692e1f31dc --no-cache notebook (#2381) 2021-03-05 15:26:27 -08:00
Glenn Jocher e931b9da33 Resume with custom anchors fix (#2361)
* Resume with custom anchors fix

* Update train.py
2021-03-03 21:06:36 -08:00
Glenn Jocher a3ecf0fd64 Anchor override (#2350) 2021-03-02 23:08:21 -08:00
Glenn Jocher fe6ebb96bb Created using Colaboratory 2021-03-02 19:20:51 -08:00
Glenn Jocher ab86cec854 FROM nvcr.io/nvidia/pytorch:21.02-py3 (#2341) 2021-03-02 13:01:59 -08:00
Glenn Jocher fab5085674 EMA bug fix 2 (#2330)
* EMA bug fix 2

* update
2021-03-01 17:13:34 -08:00
Glenn Jocher fd96810518 remove TTA 1 pixel offset (#2325) 2021-02-28 21:14:08 -08:00
Glenn Jocher c2026a5f35 Update Dockerfile install htop (#2320) 2021-02-27 15:55:31 -08:00
Glenn Jocher cd30d838eb Update test.py (#2319) 2021-02-27 15:28:23 -08:00
Glenn Jocher dfeec198cb final_epoch EMA bug fix (#2317) 2021-02-27 12:51:33 -08:00
Glenn Jocher 71dd2768f2 Improved model+EMA checkpointing 2 (#2295) 2021-02-24 21:03:21 -08:00
Glenn Jocher ec1d8496ba Improved model+EMA checkpointing (#2292)
* Enhanced model+EMA checkpointing

* update

* bug fix

* bug fix 2

* always save optimizer

* ema half

* remove model.float()

* model half

* carry ema/model in fp32

* rm model.float()

* both to float always

* cleanup

* cleanup
2021-02-24 18:26:46 -08:00
Glenn Jocher ca5b10b759 Update train.py (#2290)
* Update train.py

* Update train.py

* Update train.py

* Update train.py

* Create train.py
2021-02-24 13:31:20 -08:00
Glenn Jocher 0070995bd5 Amazon AWS EC2 startup and re-startup scripts (#2282) 2021-02-24 01:43:59 -08:00
Glenn Jocher d5d275b6e9 Amazon AWS EC2 startup and re-startup scripts (#2185)
* Amazon AWS EC2 startup and re-startup scripts

* Create resume.py

* cleanup
2021-02-23 23:10:14 -08:00
Glenn Jocher 7a6870b81f Update README.md 2021-02-23 11:27:44 -08:00
Glenn Jocher cc79f3a9ea Update Dockerfile with apt install zip (#2274) 2021-02-22 22:50:00 -08:00
Glenn Jocher 32dd1614f4 Update greetings.yml for auto-rebase on PR (#2272) 2021-02-22 18:34:07 -08:00
Glenn Jocher e27ca0d845 Update minimum stride to 32 (#2266) 2021-02-21 21:46:42 -08:00
Glenn Jocher 095d2c11d8 Created using Colaboratory 2021-02-20 13:21:58 -08:00
Glenn Jocher 6f5d6fcdaa Robust objectness loss balancing (#2256) 2021-02-20 11:19:01 -08:00
Glenn Jocher c09964c27c Update inference default to multi_label=False (#2252)
* Update inference default to multi_label=False

* bug fix

* Update plots.py

* Update plots.py
2021-02-19 15:39:09 -08:00
Glenn Jocher ab2da5edc8 Merge remote-tracking branch 'origin/master' 2021-02-19 15:21:04 -08:00
Glenn Jocher 47faf95079 reset head 2021-02-19 15:20:41 -08:00
Glenn Jocher db28ce61ac Improved hubconf.py CI tests (#2251) 2021-02-19 12:35:38 -08:00
Glenn Jocher 9d87307784 YOLOv5 Hub URL inference bug fix (#2250)
* Update common.py

* Update common.py

* Update common.py
2021-02-19 11:22:42 -08:00
Glenn Jocher d2e754b67b Add isdocker() (#2232)
* Add isdocker()

* Update general.py

* Update general.py
2021-02-16 15:58:07 -08:00
Glenn Jocher 5a40ce65ce Update CI badge (#2230) 2021-02-16 15:27:24 -08:00
Glenn Jocher 26c2e54c8f Add check_imshow() (#2231)
* Add check_imshow()

* Update general.py

* Update general.py
2021-02-16 13:56:47 -08:00
Glenn Jocher f8464b4f66 Update yolo.py channel array (#2223) 2021-02-15 21:21:53 -08:00
Glenn Jocher 7b833e37bf LoadStreams() frame loss bug fix (#2222) 2021-02-15 11:02:20 -08:00
Glenn Jocher 17ac94b796 Created using Colaboratory 2021-02-11 22:39:37 -08:00
Glenn Jocher bdd88e1ed7 YOLOv5 Segmentation Dataloader Updates (#2188)
* Update C3 module

* Update C3 module

* Update C3 module

* Update C3 module

* update

* update

* update

* update

* update

* update

* update

* update

* update

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* update

* update

* update

* update

* updates

* updates

* updates

* updates

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update datasets

* update

* update

* update

* update attempt_downlaod()

* merge

* merge

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* parameterize eps

* comments

* gs-multiple

* update

* max_nms implemented

* Create one_cycle() function

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* GitHub API rate limit fix

* update

* ComputeLoss

* ComputeLoss

* ComputeLoss

* ComputeLoss

* ComputeLoss

* ComputeLoss

* ComputeLoss

* ComputeLoss

* ComputeLoss

* ComputeLoss

* ComputeLoss

* astuple

* epochs

* update

* update

* ComputeLoss()

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* merge

* merge

* merge

* merge

* update

* update

* update

* update

* commit=tag == tags[-1]

* Update cudnn.benchmark

* update

* update

* update

* updates

* updates

* updates

* updates

* updates

* updates

* updates

* update

* update

* update

* update

* update

* mosaic9

* update

* update

* update

* update

* update

* update

* institute cache versioning

* only display on existing cache

* reverse cache exists booleans
2021-02-11 21:22:45 -08:00
Glenn Jocher 404749a33c PyTorch Hub results.save('path/to/dir') (#2179) 2021-02-10 16:10:43 -08:00