Glenn Jocher
f3c3d2ce5d
Merge `develop` branch into `master` ( #3518 )
* update ci-testing.yml (#3322 )
* update ci-testing.yml
* update greetings.yml
* bring back os matrix
* update ci-testing.yml (#3322 )
* update ci-testing.yml
* update greetings.yml
* bring back os matrix
* Enable direct `--weights URL` definition (#3373 )
* Enable direct `--weights URL` definition
@KalenMike this PR will enable direct --weights URL definition. Example use case:
```
python train.py --weights https://storage.googleapis.com/bucket/dir/model.pt
```
* cleanup
* bug fixes
* weights = attempt_download(weights)
* Update experimental.py
* Update hubconf.py
* return bug fix
* comment mirror
* min_bytes
* Update tutorial.ipynb (#3368 )
add Open in Kaggle badge
* `cv2.imread(img, -1)` for IMREAD_UNCHANGED (#3379 )
* Update datasets.py
* comment
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* COCO evolution fix (#3388 )
* COCO evolution fix
* cleanup
* update print
* print fix
* Create `is_pip()` function (#3391 )
Returns `True` if file is part of pip package. Useful for contextual behavior modification.
```python
def is_pip():
# Is file in a pip package?
return 'site-packages' in Path(__file__).absolute().parts
```
* Revert "`cv2.imread(img, -1)` for IMREAD_UNCHANGED (#3379 )" (#3395 )
This reverts commit 21a9607e00
.
* Update FLOPs description (#3422 )
* Update README.md
* Changing FLOPS to FLOPs.
Co-authored-by: BuildTools <unconfigured@null.spigotmc.org>
* Parse URL authentication (#3424 )
* Parse URL authentication
* urllib.parse.unquote()
* improved error handling
* improved error handling
* remove %3F
* update check_file()
* Add FLOPs title to table (#3453 )
* Suppress jit trace warning + graph once (#3454 )
* Suppress jit trace warning + graph once
Suppress harmless jit trace warning on TensorBoard add_graph call. Also fix multiple add_graph() calls bug, now only on batch 0.
* Update train.py
* Update MixUp augmentation `alpha=beta=32.0` (#3455 )
Per VOC empirical results https://github.com/ultralytics/yolov5/issues/3380#issuecomment-853001307 by @developer0hye
* Add `timeout()` class (#3460 )
* Add `timeout()` class
* rearrange order
* Faster HSV augmentation (#3462 )
remove datatype conversion process that can be skipped
* Add `check_git_status()` 5 second timeout (#3464 )
* Add check_git_status() 5 second timeout
This should prevent the SSH Git bug that we were discussing @KalenMike
* cleanup
* replace timeout with check_output built-in timeout
* Improved `check_requirements()` offline-handling (#3466 )
Improve robustness of `check_requirements()` function to offline environments (do not attempt pip installs when offline).
* Add `output_names` argument for ONNX export with dynamic axes (#3456 )
* Add output names & dynamic axes for onnx export
Add output_names and dynamic_axes names for all outputs in torch.onnx.export. The first four outputs of the model will have names output0, output1, output2, output3
* use first output only + cleanup
Co-authored-by: Samridha Shrestha <samridha.shrestha@g42.ai>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* Revert FP16 `test.py` and `detect.py` inference to FP32 default (#3423 )
* fixed inference bug ,while use half precision
* replace --use-half with --half
* replace space and PEP8 in detect.py
* PEP8 detect.py
* update --half help comment
* Update test.py
* revert space
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* Add additional links/resources to stale.yml message (#3467 )
* Update stale.yml
* cleanup
* Update stale.yml
* reformat
* Update stale.yml HUB URL (#3468 )
* Stale `github.actor` bug fix (#3483 )
* Explicit `model.eval()` call `if opt.train=False` (#3475 )
* call model.eval() when opt.train is False
call model.eval() when opt.train is False
* single-line if statement
* cleanup
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* check_requirements() exclude `opencv-python` (#3495 )
Fix for 3rd party or contrib versions of installed OpenCV as in https://github.com/ultralytics/yolov5/issues/3494 .
* Earlier `assert` for cpu and half option (#3508 )
* early assert for cpu and half option
early assert for cpu and half option
* Modified comment
Modified comment
* Update tutorial.ipynb (#3510 )
* Reduce test.py results spacing (#3511 )
* Update README.md (#3512 )
* Update README.md
Minor modifications
* 850 width
* Update greetings.yml
revert greeting change as PRs will now merge to master.
Co-authored-by: Piotr Skalski <SkalskiP@users.noreply.github.com>
Co-authored-by: SkalskiP <piotr.skalski92@gmail.com>
Co-authored-by: Peretz Cohen <pizzaz93@users.noreply.github.com>
Co-authored-by: tudoulei <34886368+tudoulei@users.noreply.github.com>
Co-authored-by: chocosaj <chocosaj@users.noreply.github.com>
Co-authored-by: BuildTools <unconfigured@null.spigotmc.org>
Co-authored-by: Yonghye Kwon <developer.0hye@gmail.com>
Co-authored-by: Sam_S <SamSamhuns@users.noreply.github.com>
Co-authored-by: Samridha Shrestha <samridha.shrestha@g42.ai>
Co-authored-by: edificewang <609552430@qq.com>
3 years ago
Yonghye Kwon
8d1ddc93c7
Earlier `assert` for cpu and half option ( #3508 )
* early assert for cpu and half option
early assert for cpu and half option
* Modified comment
Modified comment
3 years ago
Yonghye Kwon
a1c3572bc9
Explicit `model.eval()` call `if opt.train=False` ( #3475 )
* call model.eval() when opt.train is False
call model.eval() when opt.train is False
* single-line if statement
* cleanup
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
3 years ago
Sam_S
044daafd9d
Add `output_names` argument for ONNX export with dynamic axes ( #3456 )
* Add output names & dynamic axes for onnx export
Add output_names and dynamic_axes names for all outputs in torch.onnx.export. The first four outputs of the model will have names output0, output1, output2, output3
* use first output only + cleanup
Co-authored-by: Samridha Shrestha <samridha.shrestha@g42.ai>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
3 years ago
chocosaj
3cb9ad4fc4
Update FLOPs description ( #3422 )
* Update README.md
* Changing FLOPS to FLOPs.
Co-authored-by: BuildTools <unconfigured@null.spigotmc.org>
3 years ago
Glenn Jocher
ba6f3f974b
Enable direct `--weights URL` definition ( #3373 )
* Enable direct `--weights URL` definition
@KalenMike this PR will enable direct --weights URL definition. Example use case:
```
python train.py --weights https://storage.googleapis.com/bucket/dir/model.pt
```
* cleanup
* bug fixes
* weights = attempt_download(weights)
* Update experimental.py
* Update hubconf.py
* return bug fix
* comment mirror
* min_bytes
3 years ago
WangChaofeng
ef4d53818d
ONNX export in .train() mode fix ( #3362 )
3 years ago
Glenn Jocher
1f8d716ec9
yolo.py header ( #3347 )
3 years ago
Glenn Jocher
7b36e38cf8
Check CoreML models.train() mode ( #3262 )
* Check CoreML models.train() mode
* Update export.py
3 years ago
Adrian Holovaty
3f74cd9ed1
Parameterize max_det + inference default at 1000 ( #3215 )
* Added max_det parameters in various places
* 120 character line
* PEP8
* 120 character line
* Update inference default to 1000 instances
* Update inference default to 1000 instances
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
3 years ago
Cristi Fati
9ab561dbfc
Parameterize ONNX `--opset-version` ( #3154 )
3 years ago
Yonghye Kwon
be86c21c73
rename class autoShape -> AutoShape ( #3173 )
* rename class autoShape -> AutoShape
follow other class naming convention
* rename class autoShape -> AutoShape
follow other classes' naming convention
* rename class autoShape -> AutoShape
3 years ago
Cristi Fati
d9b4e6b748
Add `--include torchscript onnx coreml` argument ( #3137 )
* Allow users to skip exporting in formats that they don't care about
* Correct comments
* Update export.py
renamed --skip-format to --exclude
* Switched format from exclude to include (as instructed by @glenn-jocher )
* cleanup
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
3 years ago
Glenn Jocher
525f4f86a9
Add --optimize argument ( #3093 )
Fix for c++ runtime errors in https://github.com/ultralytics/yolov5/issues/2973
3 years ago
Glenn Jocher
251aeafcb1
Update P5 + P6 model ensembling ( #3082 )
3 years ago
Glenn Jocher
e97d129db4
Update export.py with --train mode argument ( #3066 )
3 years ago
Glenn Jocher
3ef3a95cfa
Do not optimize CoreML TorchScript model ( #3055 )
3 years ago
jylink
b292837e36
Fix ONNX export using --grid --simplify --dynamic simultaneously ( #2982 )
* Update yolo.py
* Update export.py
* fix export grid
* Update export.py, remove detect export attribute
* rearrange if order
* remove --grid, default inplace=False
* rename exp_dynamic to onnx_dynamic, comment
* replace bs with 1 in anchor_grid[i] index 0
* Update export.py
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
3 years ago
Hodovo
e2a80c6c0f
Add support for FP16 (half) to export.py ( #3010 )
* Added support for fp16 (half) to export.py
* minimize code additions
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
3 years ago
jluntamazon
41f5cc5637
YOLOv5 AWS Inferentia Inplace compatibility updates ( #2953 )
* Added flag to enable/disable all inplace and assignment operations
* Removed shape print statements
* Scope Detect/Model import to avoid circular dependency
* PEP8
* create _descale_pred()
* replace lost space
* replace list with tuple
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
3 years ago
Glenn Jocher
57812df68c
New Colors() class ( #2963 )
3 years ago
Glenn Jocher
4200674a13
Add yolov5/ to sys.path() for *.py subdir exec ( #2949 )
* Add yolov5/ to sys.path() for *.py subdir exec
* Update export.py
3 years ago
Glenn Jocher
4890499344
Improved yolo.py profiling ( #2940 )
* Improved yolo.py profiling
Improved column order and labelling.
* Update yolo.py
3 years ago
NanoCode012
c0d3f80544
Add verbose option to pytorch hub models ( #2926 )
* Add verbose and update print to logging
* Fix positonal param
* Revert auto formatting changes
* Update hubconf.py
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
3 years ago
Glenn Jocher
1b1ab4cca2
Add file_size() function ( #2911 )
* Add file_size() function
* Update export.py
3 years ago
Glenn Jocher
646386ff09
Update export.py for 2 dry runs ( #2910 )
* Update export.py for 2 dry runs
* Update export.py
3 years ago
Glenn Jocher
a2a514dec8
Update export.py ( #2909 )
3 years ago
Glenn Jocher
28db237639
Default optimize_for_mobile() on TorchScript models ( #2908 )
Per https://pytorch.org/tutorials/recipes/script_optimized.html this should improve performance on torchscript models (and maybe coreml models also since coremltools operates on a torchscript model input, though this still requires testing).
3 years ago
Glenn Jocher
cdb678f418
Update yolo.py ( #2899 )
3 years ago
Glenn Jocher
f7bc685c2c
Implement yaml.safe_load() ( #2876 )
* Implement yaml.safe_load()
* yaml.safe_dump()
3 years ago
Burhan
c949fc86d1
Detection cropping+saving feature addition for detect.py and PyTorch Hub ( #2827 )
* Update detect.py
* Update detect.py
* Update greetings.yml
* Update cropping
* cleanup
* Update increment_path()
* Update common.py
* Update detect.py
* Update detect.py
* Update detect.py
* Update common.py
* cleanup
* Update detect.py
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
3 years ago
Tim Stokman
1df8c6c963
Fix ONNX dynamic axes export support with onnx simplifier, make onnx simplifier optional ( #2856 )
* Ensure dynamic export works succesfully, onnx simplifier optional
* Update export.py
* add dashes
Co-authored-by: Tim <tim.stokman@hal24k.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
3 years ago
Glenn Jocher
c15e25c40f
PyTorch Hub cv2 .save() .show() bug fix ( #2831 )
* PyTorch Hub cv2 .save() .show() bug fix
cv2.rectangle() was failing on non-contiguous np array inputs. This checks for contiguous arrays and applies is necessary:
```python
imgs[i] = im if im.data.contiguous else np.ascontiguousarray(im) # update
```
* Update plots.py
```python
assert im.data.contiguous, 'Image not contiguous. Apply np.ascontiguousarray(im) to plot_on_box() input image.'
```
* Update hubconf.py
Expand CI tests to OpenCV image.
3 years ago
Glenn Jocher
1f3e482bce
ONNX Simplifier ( #2815 )
* ONNX Simplifier
Add ONNX Simplifier to ONNX export pipeline in export.py. Will auto-install onnx-simplifier if onnx is installed but onnx-simplifier is not.
* Update general.py
3 years ago
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
3 years ago
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.
3 years ago
Glenn Jocher
fca5e2a48f
autocast enable=torch.cuda.is_available() ( #2748 )
3 years ago
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
3 years ago
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
3 years ago
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
3 years ago
Glenn Jocher
17300a4c7b
autoShape forward im = np.asarray(im) # to numpy ( #2689 )
Slight speedup.
3 years ago
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
3 years ago
Ding Yiwei
1148e2ea63
Add TransformerLayer, TransformerBlock, C3TR modules ( #2333 )
* yolotr
* transformer block
* Remove bias in Transformer
* Remove C3T
* Remove a deprecated class
* put the 2nd LayerNorm into the 2nd residual block
* move example model to models/hub, rename to -transformer
* Add module comments and TODOs
* Remove LN in Transformer
* Add comments for Transformer
* Solve the problem of MA with DDP
* cleanup
* cleanup find_unused_parameters
* PEP8 reformat
Co-authored-by: DingYiwei <846414640@qq.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
3 years ago
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.
3 years ago
Glenn Jocher
005d7a8c54
Update Detections() self.n comment ( #2620 )
```python
self.n = len(self.pred) # number of images (batch size)
```
3 years ago
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
3 years ago
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
3 years ago
Ayush Chaurasia
e8fc97aa38
Improved W&B integration ( #2125 )
* Init Commit
* new wandb integration
* Update
* Use data_dict in test
* Updates
* Update: scope of log_img
* Update: scope of log_img
* Update
* Update: Fix logging conditions
* Add tqdm bar, support for .txt dataset format
* Improve Result table Logger
* Init Commit
* new wandb integration
* Update
* Use data_dict in test
* Updates
* Update: scope of log_img
* Update: scope of log_img
* Update
* Update: Fix logging conditions
* Add tqdm bar, support for .txt dataset format
* Improve Result table Logger
* Add dataset creation in training script
* Change scope: self.wandb_run
* Add wandb-artifact:// natively
you can now use --resume with wandb run links
* Add suuport for logging dataset while training
* Cleanup
* Fix: Merge conflict
* Fix: CI tests
* Automatically use wandb config
* Fix: Resume
* Fix: CI
* Enhance: Using val_table
* More resume enhancement
* FIX : CI
* Add alias
* Get useful opt config data
* train.py cleanup
* Cleanup train.py
* more cleanup
* Cleanup| CI fix
* Reformat using PEP8
* FIX:CI
* rebase
* remove uneccesary changes
* remove uneccesary changes
* remove uneccesary changes
* remove unecessary chage from test.py
* FIX: resume from local checkpoint
* FIX:resume
* FIX:resume
* Reformat
* Performance improvement
* Fix local resume
* Fix local resume
* FIX:CI
* Fix: CI
* Imporve image logging
* (:(:Redo CI tests:):)
* Remember epochs when resuming
* Remember epochs when resuming
* Update DDP location
Potential fix for #2405
* PEP8 reformat
* 0.25 confidence threshold
* reset train.py plots syntax to previous
* reset epochs completed syntax to previous
* reset space to previous
* remove brackets
* reset comment to previous
* Update: is_coco check, remove unused code
* Remove redundant print statement
* Remove wandb imports
* remove dsviz logger from test.py
* Remove redundant change from test.py
* remove redundant changes from train.py
* reformat and improvements
* Fix typo
* Add tqdm tqdm progress when scanning files, naming improvements
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
3 years ago
Glenn Jocher
f813f6dcc8
autoShape() speed profiling update ( #2460 )
3 years ago
Glenn Jocher
569757ecc0
Add autoShape() speed profiling ( #2459 )
* Add autoShape() speed profiling
* Update common.py
* Create README.md
* Update hubconf.py
* cleanuip
3 years ago