* Implement and default mlpackage generation for CoreML model exports
Signed-off-by: Ryan Hirasaki <ryanhirasaki@gmail.com>
* Provide command line argument to export as *.mlmodel instead of *.mlpackage for CoreML
Signed-off-by: Ryan Hirasaki <ryanhirasaki@gmail.com>
* Remove macOS check for CoreML quantization
Requirements for macOS during quantization was removed from coremltools 6.0
Signed-off-by: Ryan Hirasaki <ryanhirasaki@gmail.com>
* Undo removal of warning catching
Signed-off-by: Ryan Hirasaki <ryanhirasaki@gmail.com>
* Change file extension references from mlmodel to mlpackage
Signed-off-by: Ryan Hirasaki <ryanhirasaki@gmail.com>
* Auto-format by https://ultralytics.com/actions
---------
Signed-off-by: Ryan Hirasaki <ryanhirasaki@gmail.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: Ultralytics Assistant <135830346+UltralyticsAssistant@users.noreply.github.com>
* Add license line to .github/ISSUE_TEMPLATE/bug-report.yml
* Add license line to .github/ISSUE_TEMPLATE/config.yml
* Add license line to .github/ISSUE_TEMPLATE/feature-request.yml
* Add license line to .github/ISSUE_TEMPLATE/question.yml
* Add license line to .github/dependabot.yml
* Add license line to .github/workflows/ci-testing.yml
* Add license line to .github/workflows/cla.yml
* Add license line to .github/workflows/codeql-analysis.yml
* Add license line to .github/workflows/docker.yml
* Add license line to .github/workflows/format.yml
* Add license line to .github/workflows/greetings.yml
* Add license line to .github/workflows/links.yml
* Add license line to .github/workflows/merge-main-into-prs.yml
* Add license line to .github/workflows/stale.yml
* Add license line to benchmarks.py
* Add license line to classify/predict.py
* Add license line to classify/train.py
* Add license line to classify/val.py
* Add license line to data/Argoverse.yaml
* Add license line to data/GlobalWheat2020.yaml
* Add license line to data/ImageNet.yaml
* Add license line to data/ImageNet10.yaml
* Add license line to data/ImageNet100.yaml
* Add license line to data/ImageNet1000.yaml
* Add license line to data/Objects365.yaml
* Add license line to data/SKU-110K.yaml
* Add license line to data/VOC.yaml
* Add license line to data/VisDrone.yaml
* Add license line to data/coco.yaml
* Add license line to data/coco128-seg.yaml
* Add license line to data/coco128.yaml
* Add license line to data/hyps/hyp.Objects365.yaml
* Add license line to data/hyps/hyp.VOC.yaml
* Add license line to data/hyps/hyp.no-augmentation.yaml
* Add license line to data/hyps/hyp.scratch-high.yaml
* Add license line to data/hyps/hyp.scratch-low.yaml
* Add license line to data/hyps/hyp.scratch-med.yaml
* Add license line to data/xView.yaml
* Add license line to detect.py
* Add license line to export.py
* Add license line to hubconf.py
* Add license line to models/common.py
* Add license line to models/experimental.py
* Add license line to models/hub/anchors.yaml
* Add license line to models/hub/yolov3-spp.yaml
* Add license line to models/hub/yolov3-tiny.yaml
* Add license line to models/hub/yolov3.yaml
* Add license line to models/hub/yolov5-bifpn.yaml
* Add license line to models/hub/yolov5-fpn.yaml
* Add license line to models/hub/yolov5-p2.yaml
* Add license line to models/hub/yolov5-p34.yaml
* Add license line to models/hub/yolov5-p6.yaml
* Add license line to models/hub/yolov5-p7.yaml
* Add license line to models/hub/yolov5-panet.yaml
* Add license line to models/hub/yolov5l6.yaml
* Add license line to models/hub/yolov5m6.yaml
* Add license line to models/hub/yolov5n6.yaml
* Add license line to models/hub/yolov5s-LeakyReLU.yaml
* Add license line to models/hub/yolov5s-ghost.yaml
* Add license line to models/hub/yolov5s-transformer.yaml
* Add license line to models/hub/yolov5s6.yaml
* Add license line to models/hub/yolov5x6.yaml
* Add license line to models/segment/yolov5l-seg.yaml
* Add license line to models/segment/yolov5m-seg.yaml
* Add license line to models/segment/yolov5n-seg.yaml
* Add license line to models/segment/yolov5s-seg.yaml
* Add license line to models/segment/yolov5x-seg.yaml
* Add license line to models/tf.py
* Add license line to models/yolo.py
* Add license line to models/yolov5l.yaml
* Add license line to models/yolov5m.yaml
* Add license line to models/yolov5n.yaml
* Add license line to models/yolov5s.yaml
* Add license line to models/yolov5x.yaml
* Add license line to pyproject.toml
* Add license line to segment/predict.py
* Add license line to segment/train.py
* Add license line to segment/val.py
* Add license line to train.py
* Add license line to utils/__init__.py
* Add license line to utils/activations.py
* Add license line to utils/augmentations.py
* Add license line to utils/autoanchor.py
* Add license line to utils/autobatch.py
* Add license line to utils/aws/resume.py
* Add license line to utils/callbacks.py
* Add license line to utils/dataloaders.py
* Add license line to utils/downloads.py
* Add license line to utils/flask_rest_api/example_request.py
* Add license line to utils/flask_rest_api/restapi.py
* Add license line to utils/general.py
* Add license line to utils/google_app_engine/app.yaml
* Add license line to utils/loggers/__init__.py
* Add license line to utils/loggers/clearml/clearml_utils.py
* Add license line to utils/loggers/clearml/hpo.py
* Add license line to utils/loggers/comet/__init__.py
* Add license line to utils/loggers/comet/comet_utils.py
* Add license line to utils/loggers/comet/hpo.py
* Add license line to utils/loggers/wandb/wandb_utils.py
* Add license line to utils/loss.py
* Add license line to utils/metrics.py
* Add license line to utils/plots.py
* Add license line to utils/segment/augmentations.py
* Add license line to utils/segment/dataloaders.py
* Add license line to utils/segment/general.py
* Add license line to utils/segment/loss.py
* Add license line to utils/segment/metrics.py
* Add license line to utils/segment/plots.py
* Add license line to utils/torch_utils.py
* Add license line to utils/triton.py
* Add license line to val.py
* Auto-format by https://ultralytics.com/actions
* Update ImageNet1000.yaml
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* Auto-format by https://ultralytics.com/actions
---------
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* A minor correction in a comment
I added the 'h' in 'https' in the link to the label smoothing issue.
Signed-off-by: Kumar Selvakumaran <62794224+kumar-selvakumaran@users.noreply.github.com>
* Auto-format by https://ultralytics.com/actions
---------
Signed-off-by: Kumar Selvakumaran <62794224+kumar-selvakumaran@users.noreply.github.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
* Parametrize multiple of number of channels in Conv
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix issue when exporting
Signed-off-by: Angelo Delli Santi <dellisanti.angelo@gmail.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Signed-off-by: Angelo Delli Santi <dellisanti.angelo@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* Import Annotator class from `ultralytics` package
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Import Annotator class from `ultralytics` package
* Update requirements.txt
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
---------
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Fix fp16 (--half) support for TritonRemoteModel
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* Update LICENSE to AGPL-3.0
This pull request updates the license of the YOLOv5 project from GNU General Public License v3.0 (GPL-3.0) to GNU Affero General Public License v3.0 (AGPL-3.0).
We at Ultralytics have decided to make this change in order to better protect our intellectual property and ensure that any modifications made to the YOLOv5 source code will be shared back with the community when used over a network.
AGPL-3.0 is very similar to GPL-3.0, but with an additional clause to address the use of software over a network. This change ensures that if someone modifies YOLOv5 and provides it as a service over a network (e.g., through a web application or API), they must also make the source code of their modified version available to users of the service.
This update includes the following changes:
- Replace the `LICENSE` file with the AGPL-3.0 license text
- Update the license reference in the `README.md` file
- Update the license headers in source code files
We believe that this change will promote a more collaborative environment and help drive further innovation within the YOLOv5 community.
Please review the changes and let us know if you have any questions or concerns.
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* Update headers to AGPL-3.0
---------
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* Apply make_divisible for onnx models in Autoshape
At line 697 we have this `make_divisible` function for pytorch models.
* Context: we want to run inference on varied input sizes instead of fixed image size.
* When I test an image of size [720, 720] for a pytorch model (e.g., yolov5n.pt), we can see that it will be reshaped to [736, 736] by the function. This is as expected.
* When I test the same image for the onnx model (e.g., yolov5n.onnx, exported with `--dynamic`), I got an error and it's due to the indivisible problem
```
onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Non-zero status code returned while running Concat node. Name:'Concat_143' Status Message: concat.cc:156 PrepareForCompute Non concat axis dimensions must match: Axis 3 has mismatched dimensions of 45 and 46
```
The simple solution is to enable the `make_divisible` function for onnx model too.
Signed-off-by: janus-zheng <106574221+janus-zheng@users.noreply.github.com>
* revise indent
Signed-off-by: janus-zheng <106574221+janus-zheng@users.noreply.github.com>
* Apply make_divisible to all formats
All formats from DetectMultiBackend should have default stride=32
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Signed-off-by: janus-zheng <106574221+janus-zheng@users.noreply.github.com>
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Update common.py
We have a division at line 694, and then a multiplication at line 695, so it makes `y*g` not an integer. And since `shape1` will be used at line 697 to ensure the size is divisible by the `stride`, this may lead to different image size.
In my experiment, my image is [640, 640], it's divisible by the default stride 32, but I found that the result is changed to [672, 672] after line 697. So the final detection result is slightly different from that directly using the `detect.py` script, which does not call the AutoShape methods.
Signed-off-by: janus-zheng <106574221+janus-zheng@users.noreply.github.com>
Signed-off-by: janus-zheng <106574221+janus-zheng@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* added embedded meta data to tflite models
* added try block for inference
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* refactored tfite meta data into separate function
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Creat tmp file in /tmp
* Update export.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update export.py
* Update export.py
* Update export.py
* Update export.py
* Update common.py
* Update export.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update common.py
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* Allow PyTorch Hub results to display in notebooks
* fix CI
* fix CI
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix CI
* fix CI
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix CI
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix CI
* fix CI
* fix CI
* fix CI
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fix CI
* fix CI
* fix CI
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Try to fix DDP mAP drop by setting generator's seed to RANK
* Fix default activation bug
* Update dataloaders.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update dataloaders.py
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* update coco128-seg comments
* Enables detect.py to use Triton for inference
Triton Inference Server is an open source inference serving software
that streamlines AI inferencing.
https://github.com/triton-inference-server/server
The user can now provide a "--triton-url" argument to detect.py to use
a local or remote Triton server for inference.
For e.g., http://localhost:8000 will use http over port 8000
and grpc://localhost:8001 will use grpc over port 8001.
Note, it is not necessary to specify a weights file to use Triton.
A Triton container can be created by first exporting the Yolov5 model
to a Triton supported runtime. Onnx, Torchscript, TensorRT are
supported by both Triton and the export.py script.
The exported model can then be containerized via the OctoML CLI.
See https://github.com/octoml/octo-cli#getting-started for a guide.
* added triton client to requirements
* fixed support for TFSavedModels in Triton
* reverted change
* Test CoreML update
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* Update ci-testing.yml
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* Use pathlib
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* Refacto DetectMultiBackend to directly accept triton url as --weights http://...
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* Deploy category
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* Update detect.py
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* Update common.py
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* Update common.py
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* Update predict.py
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* Update predict.py
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* Update predict.py
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* Update triton.py
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* Update triton.py
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add printout and requirements check
* Cleanup
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* triton fixes
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* fixed triton model query over grpc
* Update check_requirements('tritonclient[all]')
* group imports
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix likely remote URL bug
* update comment
* Update is_url()
* Fix 2x download attempt on http://path/to/model.pt
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: glennjocher <glenn.jocher@ultralytics.com>
Co-authored-by: Gaz Iqbal <giqbal@octoml.ai>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Detect() and Segment() fixes for CoreML and Paddle
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>