Commit Graph

140 Commits (fcb225c1c81a17fbaeff027b1f4be5300049e8a8)

Author SHA1 Message Date
Glenn Jocher c3a93d783d
Add TensorFlow formats to `export.py` (#4479)
* Initial commit

* Remove unused export_torchscript return

* ROOT variable

* Add prefix to fcn arg

* fix ROOT

* check_yaml into run()

* interim fixes

* imgsz=(320, 320)

* Hardcode tf_raw_resize False

* Finish opt elimination

* Update representative_dataset_gen()

* Update export.py with TF methods

* SiLU and GraphDef fixes

* file_size() directory handling feature

* export fixes

* add lambda: to representative_dataset

* Detect training False default

* Fuse false for TF models

* Embed agnostic NMS arguments

* Remove lambda

* TensorFlow.js export success

* Add pb to Usage

* Add *_tfjs_model/ to ignore files

* prepend YOLOv5 to function headers

* Remove end --- comments

* parameterize tfjs export pb file

* update run() data default /ROOT

* update --include help

* update imports

* return ct_model

* Consolidate TFLite export

* pb prerequisite to tfjs

* TF modules CamelCase

* Remove exports from tf.py and cleanup

* pass agnostic NMS arguments

* CI

* CI

* ignore *_web_model/

* Add tensorflow to CI dependencies

* CI tensorflow-cpu

* Update requirements.txt

* Remove tensorflow check_requirement

* CI coreml tfjs

* export only onnx torchscript

* reorder exports torchscript first
2021-09-12 15:52:24 +02:00
Glenn Jocher c47be26f34
Replace `path.absolute()` with `path.resolve()` (#4763) 2021-09-11 22:46:33 +02:00
Glenn Jocher cd810c8286
Centralize `user_config_dir()` decision making (#4755) 2021-09-11 16:32:08 +02:00
Glenn Jocher 22ee6fb7c1
Update `is_writeable()` for 2 methods (#4744)
* Writeable test

* Fix

* Cleanup
2021-09-10 17:52:33 +02:00
Glenn Jocher a144536f88
Fix `is_writeable()` for 3 OS support (#4743)
* Fix `is_writeable()` for 3 OS support

* Update general.py
2021-09-10 17:06:22 +02:00
Glenn Jocher 4a025ae97f
Fix `user_config_dir()` for GCP/AWS functions (#4726)
* Fix `user_config_dir()` for GCP/AWS functions

Compatability fix for GCP functions and AWS lambda for user config directory in https://github.com/ultralytics/yolov5/pull/4628

* Windows skip check
2021-09-09 17:57:46 +02:00
Glenn Jocher 8e94bf62d9
Add `user_config_dir('Ultralytics')` (#4715)
* Add `user_config_dir`

* Linux to .config
2021-09-08 18:13:59 +02:00
Glenn Jocher 25a7e1dae5
Update `check_yaml()` comment (#4713)
* Update `check_yaml()` comment

* Cleanup
2021-09-08 16:01:03 +02:00
Glenn Jocher f984cce52a
Fix `check_suffix()` (#4712)
Fix a bug when `file=''`
2021-09-08 15:06:31 +02:00
Glenn Jocher a2b3c71636
Add suffix checks (#4711)
* Add suffix checks

* Cleanup

* Cleanup2

* Cleanup3
2021-09-08 14:36:12 +02:00
Glenn Jocher 3a72d4a7e3
Update `check_git_status()` warning (#4610) 2021-08-30 17:05:45 +02:00
Glenn Jocher e5e5ebc799
Auto-UTF handling (#4594) 2021-08-29 17:15:18 +02:00
Glenn Jocher de44376d1b
Create `Annotator()` class (#4591)
* Add Annotator() class

* Download Arial

* 2x for loop

* Cleanup

* tuple 2 list

* max_size=1920

* bold logging results to

* tolist()

* im = annotator.im

* PIL save in detect.py

* Smart asarray in detect.py

* revert to cv2.imwrite

* Cleanup

* Return result asarray

* Add `Profile()` profiler

* CamelCase Timeout

* Resize after mosaic

* pillow>=8.0.0

* daemon imwrite

* Add cv2 support

* Remove plot_wh_methods and plot_one_box

* pil=False for hubconf.py annotations

* im.shape bug fix

* colorstr common.py

* join daemons

* Update t.daemon

* Removed daemon saving
2021-08-29 16:46:13 +02:00
Glenn Jocher bbfafeabdb
Add `Profile()` profiler (#4587)
* Add `Profile()` profiler

* CamelCase Timeout
2021-08-29 13:49:04 +02:00
Glenn Jocher 7b1643b5b5
Add `install=True` argument to `check_requirements` (#4512)
* Add `install=True` argument to `check_requirements`

* Update general.py
2021-08-23 14:38:30 +02:00
Glenn Jocher f3e3f7603f
TFLite prep (#4436) 2021-08-16 17:25:06 +02:00
Glenn Jocher 24bea5e4b7
Standardize headers and docstrings (#4417)
* Implement new headers

* Reformat 1

* Reformat 2

* Reformat 3 - math

* Reformat 4 - yaml
2021-08-14 21:17:51 +02:00
Glenn Jocher 2da4e7acf7
Merge PIL and OpenCV in `plot_one_box(use_pil=False)` (#4416)
* Merge PIL and OpenCV box plotting functions

* Add ASCII check to plot_one_box

* Cleanup

* Cleanup2
2021-08-14 17:44:15 +02:00
Glenn Jocher 63e09fdc48
Remove `encoding='ascii'` (#4413)
* Remove `encoding='ascii'`

* Reinstate `encoding='ascii'` in emojis()
2021-08-14 13:47:20 +02:00
Glenn Jocher e78aeac973
Evolve in CSV format (#4307)
* Update evolution to CSV format

* Update

* Update

* Update

* Update

* Update

* reset args

* reset args

* reset args

* plot_results() fix

* Cleanup

* Cleanup2
2021-08-04 17:13:38 +02:00
Kalen Michael b74929c910
Add `train.py` and `val.py` callbacks (#4220)
* added callbacks

* Update callbacks.py

* Update train.py

* Update val.py

* Fix CamlCase add staticmethod

* Refactor logger into callbacks

* Cleanup

* New callback on_val_image_end()

* Add curves and results images to TensorBoard

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-08-01 00:18:07 +02:00
Glenn Jocher 7820614c40
Add `@try_except` decorator (#4224) 2021-07-29 17:23:35 +02:00
Glenn Jocher 5d66e48723
Train from `--data path/to/dataset.zip` feature (#4185)
* Train from `--data path/to/dataset.zip` feature

* Update dataset_stats()

* cleanup

* cleanup2
2021-07-28 02:04:10 +02:00
Glenn Jocher 63dd65e7ed
Update train.py (#4136)
* Refactor train.py

* Update imports

* Update imports

* Update optimizer

* cleanup
2021-07-24 16:11:39 +02:00
Glenn Jocher 2c073cd207
Add train.py ``--img-size` floor (#4099) 2021-07-21 16:50:47 +02:00
Glenn Jocher c8a98cb7cb
Missing `nc` and `names` handling in check_dataset() (#4066) 2021-07-19 13:10:21 +02:00
Glenn Jocher 720aaa65c8
Rename `test.py` to `val.py` (#4000) 2021-07-14 15:43:54 +02:00
Glenn Jocher 80299a57e2
Numerical stability fix for Albumentations (#3958) 2021-07-10 19:50:53 +02:00
Glenn Jocher 33202b7f0b
YOLOv5 + Albumentations integration (#3882)
* Albumentations integration

* ToGray p=0.01

* print confirmation

* create instance in dataloader init method

* improved version handling

* transform not defined fix

* assert string update

* create check_version()

* add spaces

* update class comment
2021-07-05 18:01:54 +02:00
Glenn Jocher 5ea771d93d
Move IoU functions to metrics.py (#3820) 2021-06-29 13:18:13 +02:00
Glenn Jocher f89941711c
NGA xView 2018 Dataset Auto-Download (#3775)
* update clip_coords for numpy

* uncomment

* cleanup

* Add autosplits

* fix

* cleanup
2021-06-26 00:49:05 +02:00
Yonghye Kwon 374957317a
Add `xyxy2xywhn()` (#3765)
* Edit Comments for numpy2torch tensor process

Edit Comments for numpy2torch tensor process

* add xyxy2xywhn

add xyxy2xywhn

* add xyxy2xywhn

* formatting

* pass arguments

pass arguments

* edit comment for xyxy2xywhn()

edit comment for xyxy2xywhn()

* cleanup datasets.py

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-06-25 11:47:46 +02:00
Glenn Jocher f79d7479da
Add optional dataset.yaml `path` attribute (#3753)
* Add optional dataset.yaml `path` attribute

@KalenMike

* pass locals to python scripts

* handle lists

* update coco128.yaml

* Capitalize first letter

* add test key

* finalize GlobalWheat2020.yaml

* finalize objects365.yaml

* finalize SKU-110K.yaml

* finalize SKU-110K.yaml

* finalize VisDrone.yaml

* NoneType fix

* update download comment

* voc to VOC

* update

* update VOC.yaml

* update VOC.yaml

* remove dashes

* delete get_voc.sh

* force coco and coco128 to ../datasets

* Capitalize Argoverse_HD.yaml

* Capitalize Objects365.yaml

* update Argoverse_HD.yaml

* coco segments fix

* VOC single-thread

* update Argoverse_HD.yaml

* update data_dict in test handling

* create root
2021-06-25 01:25:03 +02:00
Glenn Jocher 63060910a6
Update `check_datasets()` for dynamic unzip path (#3732)
@KalenMike
2021-06-22 16:05:38 +02:00
Glenn Jocher 7d3686a686
Update `check_file()` (#3622)
* Update `check_file()`

* Update datasets.py
2021-06-15 13:21:04 +02:00
Glenn Jocher f8ec71e1c2
Update `check_python(minimum=3.6.2)` (#3548) 2021-06-09 11:34:15 +02:00
Glenn Jocher 1b5edb6f8e
Update `dataset_stats()` for HUB (#3536)
* Update `dataset_stats()` for HUB 

Cleanup of b6fdd2e

* autodownload flag

* Update general.py

* cleanup
2021-06-09 10:56:11 +02:00
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>
2021-06-08 10:22:10 +02:00
Glenn Jocher 2435bfe896
Add URL download to check_file() (#3330)
* Add URL file download to check_file()

* cleanup

* pathlib bug fix
2021-05-26 15:51:49 +02:00
Glenn Jocher 9f3a388cea
Improved check_requirements() robustness (#3298)
Add try: except clause on missing requirements install to catch install failures. Prompted by Ultralytics YOLOv5 API failure on Cython.
2021-05-23 18:00:23 +02:00
yeric1789 a039b7796d
PyTorch Hub `crops = results.crop()` return values (#3282)
* Changing save_one_box 

Made to work with other changes to common.py

* PEP8 and single line BGR

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
2021-05-23 16:00:55 +02:00
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>
2021-05-17 22:47:44 +02:00
Glenn Jocher 57b0d3a605
Add check_python() (#3088)
* Add check_python()

Checks python version against minimum version of 3.7.0.

* remove packaging dependency

* refactor import
2021-05-09 15:33:38 +02:00
Glenn Jocher 8cab907f60
download() ThreadPool update (#3027)
* download() ThreadPool update

* update train image count

* cid + 1
2021-05-04 23:37:31 +02:00
Glenn Jocher 5189b3addb Objects365 Update 2021-05-04 02:25:14 +02:00
Glenn Jocher 41cc7caee6
Add NMS threshold checks (#3020)
* Add NMS threshold checks

* fix
2021-05-03 15:07:20 +02:00
Glenn Jocher fcd57028d2
Add is_colab() function (#3018) 2021-05-03 12:37:50 +02:00
Glenn Jocher 37eaffec7d
Curl update (#3004)
* Curl update

* Curl update
2021-05-01 17:29:51 +02:00
Glenn Jocher 4d7bca7648
Add unzip flag to download() (#3002) 2021-05-01 12:37:41 +02:00
Glenn Jocher 54652fe3ff Objects365 update 2021-05-01 00:16:58 +02:00