Update YOLOv5<>Comet ML READMEs (#13560)
* Update links.yml Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> * Update links.yml Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> * Update YOLOv5 Comet READMEs * Auto-format by https://ultralytics.com/actions --------- Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>pull/13558/merge
parent
f4d8a84c38
commit
79355eb1b2
|
@ -33,13 +33,14 @@ jobs:
|
|||
retry_delay_seconds: 60
|
||||
retries: 2
|
||||
run: |
|
||||
set -o pipefail # preserve exit code from lychee command in pipeline
|
||||
lychee \
|
||||
--scheme 'https' \
|
||||
--timeout 60 \
|
||||
--insecure \
|
||||
--accept 403,429,500,502,999 \
|
||||
--exclude-all-private \
|
||||
--exclude 'https?://(www\.)?(linkedin\.com|twitter\.com|instagram\.com|kaggle\.com|fonts\.gstatic\.com|url\.com)' \
|
||||
--exclude 'https?://(www\.)?(linkedin\.com|twitter\.com|x\.com|instagram\.com|kaggle\.com|fonts\.gstatic\.com|url\.com)' \
|
||||
--exclude-path '**/ci.yaml' \
|
||||
--github-token ${{ secrets.GITHUB_TOKEN }} \
|
||||
--header "User-Agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.6478.183 Safari/537.36" \
|
||||
|
@ -54,13 +55,14 @@ jobs:
|
|||
retry_delay_seconds: 60
|
||||
retries: 2
|
||||
run: |
|
||||
set -o pipefail # preserve exit code from lychee command in pipeline
|
||||
lychee \
|
||||
--scheme 'https' \
|
||||
--timeout 60 \
|
||||
--insecure \
|
||||
--accept 429,999 \
|
||||
--exclude-all-private \
|
||||
--exclude 'https?://(www\.)?(linkedin\.com|twitter\.com|instagram\.com|kaggle\.com|fonts\.gstatic\.com|url\.com)' \
|
||||
--exclude 'https?://(www\.)?(linkedin\.com|twitter\.com|x\.com|instagram\.com|kaggle\.com|fonts\.gstatic\.com|url\.com)' \
|
||||
--exclude-path '**/ci.yaml' \
|
||||
--github-token ${{ secrets.GITHUB_TOKEN }} \
|
||||
--header "User-Agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.6478.183 Safari/537.36" \
|
||||
|
|
|
@ -58,7 +58,7 @@ If you spot a problem with YOLOv5 please submit a Bug Report!
|
|||
|
||||
For us to start investigating a possible problem we need to be able to reproduce it ourselves first. We've created a few short guidelines below to help users provide what we need to get started.
|
||||
|
||||
When asking a question, people will be better able to provide help if you provide **code** that they can easily understand and use to **reproduce** the problem. This is referred to by community members as creating a [minimum reproducible example](https://docs.ultralytics.com/help/minimum_reproducible_example/). Your code that reproduces the problem should be:
|
||||
When asking a question, people will be better able to provide help if you provide **code** that they can easily understand and use to **reproduce** the problem. This is referred to by community members as creating a [minimum reproducible example](https://docs.ultralytics.com/help/minimum-reproducible-example/). Your code that reproduces the problem should be:
|
||||
|
||||
- ✅ **Minimal** – Use as little code as possible that still produces the same problem
|
||||
- ✅ **Complete** – Provide **all** parts someone else needs to reproduce your problem in the question itself
|
||||
|
@ -69,7 +69,7 @@ In addition to the above requirements, for [Ultralytics](https://www.ultralytics
|
|||
- ✅ **Current** – Verify that your code is up-to-date with the current GitHub [master](https://github.com/ultralytics/yolov5/tree/master), and if necessary `git pull` or `git clone` a new copy to ensure your problem has not already been resolved by previous commits.
|
||||
- ✅ **Unmodified** – Your problem must be reproducible without any modifications to the codebase in this repository. [Ultralytics](https://www.ultralytics.com/) does not provide support for custom code ⚠️.
|
||||
|
||||
If you believe your problem meets all of the above criteria, please close this issue and raise a new one using the 🐛 **Bug Report** [template](https://github.com/ultralytics/yolov5/issues/new/choose) and provide a [minimum reproducible example](https://docs.ultralytics.com/help/minimum_reproducible_example/) to help us better understand and diagnose your problem.
|
||||
If you believe your problem meets all of the above criteria, please close this issue and raise a new one using the 🐛 **Bug Report** [template](https://github.com/ultralytics/yolov5/issues/new/choose) and provide a [minimum reproducible example](https://docs.ultralytics.com/help/minimum-reproducible-example/) to help us better understand and diagnose your problem.
|
||||
|
||||
## License
|
||||
|
||||
|
|
14
README.md
14
README.md
|
@ -181,7 +181,7 @@ python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov5x.yaml --
|
|||
- **[Multi-GPU Training](https://docs.ultralytics.com/yolov5/tutorials/multi_gpu_training/)**: Speed up training using multiple GPUs.
|
||||
- **[PyTorch Hub Integration](https://docs.ultralytics.com/yolov5/tutorials/pytorch_hub_model_loading/)** 🌟 **NEW**: Easily load models using PyTorch Hub.
|
||||
- **[Model Export (TFLite, ONNX, CoreML, TensorRT)](https://docs.ultralytics.com/yolov5/tutorials/model_export/)** 🚀: Convert your models to various deployment formats like [ONNX](https://onnx.ai/) or [TensorRT](https://developer.nvidia.com/tensorrt).
|
||||
- **[NVIDIA Jetson Deployment](https://docs.ultralytics.com/yolov5/tutorials/running_on_jetson_nano/)** 🌟 **NEW**: Deploy YOLOv5 on [NVIDIA Jetson](https://developer.nvidia.com/embedded-computing) devices.
|
||||
- **[NVIDIA Jetson Deployment](https://docs.ultralytics.com/guides/nvidia-jetson/)** 🌟 **NEW**: Deploy YOLOv5 on [NVIDIA Jetson](https://developer.nvidia.com/embedded-computing) devices.
|
||||
- **[Test-Time Augmentation (TTA)](https://docs.ultralytics.com/yolov5/tutorials/test_time_augmentation/)**: Enhance prediction accuracy with TTA.
|
||||
- **[Model Ensembling](https://docs.ultralytics.com/yolov5/tutorials/model_ensembling/)**: Combine multiple models for better performance.
|
||||
- **[Model Pruning/Sparsity](https://docs.ultralytics.com/yolov5/tutorials/model_pruning_and_sparsity/)**: Optimize models for size and speed.
|
||||
|
@ -191,7 +191,7 @@ python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov5x.yaml --
|
|||
- **[Ultralytics HUB Training](https://www.ultralytics.com/hub)** 🚀 **RECOMMENDED**: Train and deploy YOLO models using Ultralytics HUB.
|
||||
- **[ClearML Logging](https://docs.ultralytics.com/yolov5/tutorials/clearml_logging_integration/)**: Integrate with [ClearML](https://clear.ml/) for experiment tracking.
|
||||
- **[Neural Magic DeepSparse Integration](https://docs.ultralytics.com/yolov5/tutorials/neural_magic_pruning_quantization/)**: Accelerate inference with DeepSparse.
|
||||
- **[Comet Logging](https://docs.ultralytics.com/yolov5/tutorials/comet_logging_integration/)** 🌟 **NEW**: Log experiments using [Comet ML](https://www.comet.com/).
|
||||
- **[Comet Logging](https://docs.ultralytics.com/yolov5/tutorials/comet_logging_integration/)** 🌟 **NEW**: Log experiments using [Comet ML](https://www.comet.com/site/).
|
||||
|
||||
</details>
|
||||
|
||||
|
@ -219,9 +219,9 @@ Our key integrations with leading AI platforms extend the functionality of Ultra
|
|||
<img src="https://github.com/ultralytics/assets/raw/main/partners/logo-neuralmagic.png" width="10%" alt="Neural Magic logo"></a>
|
||||
</div>
|
||||
|
||||
| Ultralytics HUB 🌟 | Weights & Biases | Comet | Neural Magic |
|
||||
| :----------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------: |
|
||||
| Streamline YOLO workflows: Label, train, and deploy effortlessly with [Ultralytics HUB](https://hub.ultralytics.com). Try now! | Track experiments, hyperparameters, and results with [Weights & Biases](https://docs.ultralytics.com/integrations/weights-biases/). | Free forever, [Comet ML](https://docs.ultralytics.com/integrations/comet/) lets you save YOLO models, resume training, and interactively visualize predictions. | Run YOLO inference up to 6x faster with [Neural Magic DeepSparse](https://docs.ultralytics.com/integrations/neural-magic/). |
|
||||
| Ultralytics HUB 🌟 | Weights & Biases | Comet | Neural Magic |
|
||||
| :-----------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------: |
|
||||
| Streamline YOLO workflows: Label, train, and deploy effortlessly with [Ultralytics HUB](https://hub.ultralytics.com/). Try now! | Track experiments, hyperparameters, and results with [Weights & Biases](https://docs.ultralytics.com/integrations/weights-biases/). | Free forever, [Comet ML](https://docs.ultralytics.com/integrations/comet/) lets you save YOLO models, resume training, and interactively visualize predictions. | Run YOLO inference up to 6x faster with [Neural Magic DeepSparse](https://docs.ultralytics.com/integrations/neural-magic/). |
|
||||
|
||||
## ⭐ Ultralytics HUB
|
||||
|
||||
|
@ -244,7 +244,7 @@ YOLOv5 is designed for simplicity and ease of use. We prioritize real-world perf
|
|||
<summary>Figure Notes</summary>
|
||||
|
||||
- **COCO AP val** denotes the [mean Average Precision (mAP)](https://www.ultralytics.com/glossary/mean-average-precision-map) at [Intersection over Union (IoU)](https://www.ultralytics.com/glossary/intersection-over-union-iou) thresholds from 0.5 to 0.95, measured on the 5,000-image [COCO val2017 dataset](https://docs.ultralytics.com/datasets/detect/coco/) across various inference sizes (256 to 1536 pixels).
|
||||
- **GPU Speed** measures the average inference time per image on the [COCO val2017 dataset](https://docs.ultralytics.com/datasets/detect/coco/) using an [AWS p3.2xlarge V100 instance](https://aws.amazon.com/ec2/instance-types/p3/) with a batch size of 32.
|
||||
- **GPU Speed** measures the average inference time per image on the [COCO val2017 dataset](https://docs.ultralytics.com/datasets/detect/coco/) using an [AWS p3.2xlarge V100 instance](https://aws.amazon.com/ec2/instance-types/p4/) with a batch size of 32.
|
||||
- **EfficientDet** data is sourced from the [google/automl repository](https://github.com/google/automl) at batch size 8.
|
||||
- **Reproduce** these results using the command: `python val.py --task study --data coco.yaml --iou 0.7 --weights yolov5n6.pt yolov5s6.pt yolov5m6.pt yolov5l6.pt yolov5x6.pt`
|
||||
|
||||
|
@ -273,7 +273,7 @@ This table shows the performance metrics for various YOLOv5 models trained on th
|
|||
|
||||
- All checkpoints were trained for 300 epochs using default settings. Nano (n) and Small (s) models use [hyp.scratch-low.yaml](https://github.com/ultralytics/yolov5/blob/master/data/hyps/hyp.scratch-low.yaml) hyperparameters, while Medium (m), Large (l), and Extra-Large (x) models use [hyp.scratch-high.yaml](https://github.com/ultralytics/yolov5/blob/master/data/hyps/hyp.scratch-high.yaml).
|
||||
- **mAP<sup>val</sup>** values represent single-model, single-scale performance on the [COCO val2017 dataset](https://docs.ultralytics.com/datasets/detect/coco/).<br>Reproduce using: `python val.py --data coco.yaml --img 640 --conf 0.001 --iou 0.65`
|
||||
- **Speed** metrics are averaged over COCO val images using an [AWS p3.2xlarge V100 instance](https://aws.amazon.com/ec2/instance-types/p3/). Non-Maximum Suppression (NMS) time (~1 ms/image) is not included.<br>Reproduce using: `python val.py --data coco.yaml --img 640 --task speed --batch 1`
|
||||
- **Speed** metrics are averaged over COCO val images using an [AWS p3.2xlarge V100 instance](https://aws.amazon.com/ec2/instance-types/p4/). Non-Maximum Suppression (NMS) time (~1 ms/image) is not included.<br>Reproduce using: `python val.py --data coco.yaml --img 640 --task speed --batch 1`
|
||||
- **TTA** ([Test Time Augmentation](https://docs.ultralytics.com/yolov5/tutorials/test_time_augmentation/)) includes reflection and scale augmentations for improved accuracy.<br>Reproduce using: `python val.py --data coco.yaml --img 1536 --iou 0.7 --augment`
|
||||
|
||||
</details>
|
||||
|
|
|
@ -181,7 +181,7 @@ python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov5x.yaml --
|
|||
- **[多 GPU 训练](https://docs.ultralytics.com/yolov5/tutorials/multi_gpu_training/)**:使用多个 GPU 加速训练。
|
||||
- **[PyTorch Hub 集成](https://docs.ultralytics.com/yolov5/tutorials/pytorch_hub_model_loading/)** 🌟 **新增**:使用 PyTorch Hub 轻松加载模型。
|
||||
- **[模型导出 (TFLite, ONNX, CoreML, TensorRT)](https://docs.ultralytics.com/yolov5/tutorials/model_export/)** 🚀:将您的模型转换为各种部署格式,如 [ONNX](https://onnx.ai/) 或 [TensorRT](https://developer.nvidia.com/tensorrt)。
|
||||
- **[NVIDIA Jetson 部署](https://docs.ultralytics.com/yolov5/tutorials/running_on_jetson_nano/)** 🌟 **新增**:在 [NVIDIA Jetson](https://developer.nvidia.com/embedded-computing) 设备上部署 YOLOv5。
|
||||
- **[NVIDIA Jetson 部署](https://docs.ultralytics.com/guides/nvidia-jetson/)** 🌟 **新增**:在 [NVIDIA Jetson](https://developer.nvidia.com/embedded-computing) 设备上部署 YOLOv5。
|
||||
- **[测试时增强 (TTA)](https://docs.ultralytics.com/yolov5/tutorials/test_time_augmentation/)**:使用 TTA 提高预测准确性。
|
||||
- **[模型集成](https://docs.ultralytics.com/yolov5/tutorials/model_ensembling/)**:组合多个模型以获得更好的性能。
|
||||
- **[模型剪枝/稀疏化](https://docs.ultralytics.com/yolov5/tutorials/model_pruning_and_sparsity/)**:优化模型的大小和速度。
|
||||
|
@ -191,7 +191,7 @@ python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov5x.yaml --
|
|||
- **[Ultralytics HUB 训练](https://www.ultralytics.com/hub)** 🚀 **推荐**:使用 Ultralytics HUB 训练和部署 YOLO 模型。
|
||||
- **[ClearML 日志记录](https://docs.ultralytics.com/yolov5/tutorials/clearml_logging_integration/)**:与 [ClearML](https://clear.ml/) 集成以进行实验跟踪。
|
||||
- **[Neural Magic DeepSparse 集成](https://docs.ultralytics.com/yolov5/tutorials/neural_magic_pruning_quantization/)**:使用 DeepSparse 加速推理。
|
||||
- **[Comet 日志记录](https://docs.ultralytics.com/yolov5/tutorials/comet_logging_integration/)** 🌟 **新增**:使用 [Comet ML](https://www.comet.com/) 记录实验。
|
||||
- **[Comet 日志记录](https://docs.ultralytics.com/yolov5/tutorials/comet_logging_integration/)** 🌟 **新增**:使用 [Comet ML](https://www.comet.com/site/) 记录实验。
|
||||
|
||||
</details>
|
||||
|
||||
|
@ -219,9 +219,9 @@ python train.py --data coco.yaml --epochs 300 --weights '' --cfg yolov5x.yaml --
|
|||
<img src="https://github.com/ultralytics/assets/raw/main/partners/logo-neuralmagic.png" width="10%" alt="Neural Magic logo"></a>
|
||||
</div>
|
||||
|
||||
| Ultralytics HUB 🌟 | Weights & Biases | Comet | Neural Magic |
|
||||
| :------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------: |
|
||||
| 简化 YOLO 工作流程:使用 [Ultralytics HUB](https://hub.ultralytics.com) 轻松标注、训练和部署。立即试用! | 使用 [Weights & Biases](https://docs.ultralytics.com/integrations/weights-biases/) 跟踪实验、超参数和结果。 | 永久免费的 [Comet ML](https://docs.ultralytics.com/integrations/comet/) 让您保存 YOLO 模型、恢复训练并交互式地可视化预测。 | 使用 [Neural Magic DeepSparse](https://docs.ultralytics.com/integrations/neural-magic/) 将 YOLO 推理速度提高多达 6 倍。 |
|
||||
| Ultralytics HUB 🌟 | Weights & Biases | Comet | Neural Magic |
|
||||
| :-------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------: |
|
||||
| 简化 YOLO 工作流程:使用 [Ultralytics HUB](https://hub.ultralytics.com/) 轻松标注、训练和部署。立即试用! | 使用 [Weights & Biases](https://docs.ultralytics.com/integrations/weights-biases/) 跟踪实验、超参数和结果。 | 永久免费的 [Comet ML](https://docs.ultralytics.com/integrations/comet/) 让您保存 YOLO 模型、恢复训练并交互式地可视化预测。 | 使用 [Neural Magic DeepSparse](https://docs.ultralytics.com/integrations/neural-magic/) 将 YOLO 推理速度提高多达 6 倍。 |
|
||||
|
||||
## ⭐ Ultralytics HUB
|
||||
|
||||
|
@ -244,7 +244,7 @@ YOLOv5 的设计旨在简单易用。我们优先考虑实际性能和可访问
|
|||
<summary>图表说明</summary>
|
||||
|
||||
- **COCO AP val** 表示在 [交并比 (IoU)](https://www.ultralytics.com/glossary/intersection-over-union-iou) 阈值从 0.5 到 0.95 范围内的[平均精度均值 (mAP)](https://www.ultralytics.com/glossary/mean-average-precision-map),在包含 5000 张图像的 [COCO val2017 数据集](https://docs.ultralytics.com/datasets/detect/coco/)上,使用各种推理尺寸(256 到 1536 像素)测量得出。
|
||||
- **GPU Speed** 使用批处理大小为 32 的 [AWS p3.2xlarge V100 实例](https://aws.amazon.com/ec2/instance-types/p3/),测量在 [COCO val2017 数据集](https://docs.ultralytics.com/datasets/detect/coco/)上每张图像的平均推理时间。
|
||||
- **GPU Speed** 使用批处理大小为 32 的 [AWS p3.2xlarge V100 实例](https://aws.amazon.com/ec2/instance-types/p4/),测量在 [COCO val2017 数据集](https://docs.ultralytics.com/datasets/detect/coco/)上每张图像的平均推理时间。
|
||||
- **EfficientDet** 数据来源于 [google/automl 仓库](https://github.com/google/automl),批处理大小为 8。
|
||||
- **复现**这些结果请使用命令:`python val.py --task study --data coco.yaml --iou 0.7 --weights yolov5n6.pt yolov5s6.pt yolov5m6.pt yolov5l6.pt yolov5x6.pt`
|
||||
|
||||
|
@ -273,7 +273,7 @@ YOLOv5 的设计旨在简单易用。我们优先考虑实际性能和可访问
|
|||
|
||||
- 所有预训练权重均使用默认设置训练了 300 个周期。Nano (n) 和 Small (s) 模型使用 [hyp.scratch-low.yaml](https://github.com/ultralytics/yolov5/blob/master/data/hyps/hyp.scratch-low.yaml) 超参数,而 Medium (m)、Large (l) 和 Extra-Large (x) 模型使用 [hyp.scratch-high.yaml](https://github.com/ultralytics/yolov5/blob/master/data/hyps/hyp.scratch-high.yaml)。
|
||||
- **mAP<sup>val</sup>** 值表示在 [COCO val2017 数据集](https://docs.ultralytics.com/datasets/detect/coco/)上的单模型、单尺度性能。<br>复现请使用:`python val.py --data coco.yaml --img 640 --conf 0.001 --iou 0.65`
|
||||
- **速度**指标是在 [AWS p3.2xlarge V100 实例](https://aws.amazon.com/ec2/instance-types/p3/)上对 COCO val 图像进行平均测量的。不包括非极大值抑制 (NMS) 时间(约 1 毫秒/图像)。<br>复现请使用:`python val.py --data coco.yaml --img 640 --task speed --batch 1`
|
||||
- **速度**指标是在 [AWS p3.2xlarge V100 实例](https://aws.amazon.com/ec2/instance-types/p4/)上对 COCO val 图像进行平均测量的。不包括非极大值抑制 (NMS) 时间(约 1 毫秒/图像)。<br>复现请使用:`python val.py --data coco.yaml --img 640 --task speed --batch 1`
|
||||
- **TTA** ([测试时增强](https://docs.ultralytics.com/yolov5/tutorials/test_time_augmentation/)) 包括反射和尺度增强以提高准确性。<br>复现请使用:`python val.py --data coco.yaml --img 1536 --iou 0.7 --augment`
|
||||
|
||||
</details>
|
||||
|
|
|
@ -1067,7 +1067,7 @@ def add_tflite_metadata(file, metadata, num_outputs):
|
|||
Note:
|
||||
TFLite metadata can include information such as model name, version, author, and other relevant details.
|
||||
For more details on the structure of the metadata, refer to TensorFlow Lite
|
||||
[metadata guidelines](https://www.tensorflow.org/lite/models/convert/metadata).
|
||||
[metadata guidelines](https://ai.google.dev/edge/litert/models/metadata).
|
||||
"""
|
||||
with contextlib.suppress(ImportError):
|
||||
# check_requirements('tflite_support')
|
||||
|
|
|
@ -47,7 +47,7 @@ def _create(name, pretrained=True, channels=3, classes=80, autoshape=True, verbo
|
|||
|
||||
Notes:
|
||||
For more information on model loading and customization, visit the
|
||||
[YOLOv5 PyTorch Hub Documentation](https://docs.ultralytics.com/yolov5/tutorials/pytorch_hub_model_loading).
|
||||
[YOLOv5 PyTorch Hub Documentation](https://docs.ultralytics.com/yolov5/tutorials/pytorch_hub_model_loading/).
|
||||
"""
|
||||
from pathlib import Path
|
||||
|
||||
|
@ -210,7 +210,7 @@ def yolov5s(pretrained=True, channels=3, classes=80, autoshape=True, _verbose=Tr
|
|||
|
||||
Notes:
|
||||
For more details on model loading and customization, visit
|
||||
the [YOLOv5 PyTorch Hub Documentation](https://pytorch.org/hub/ultralytics_yolov5).
|
||||
the [YOLOv5 PyTorch Hub Documentation](https://pytorch.org/hub/ultralytics_yolov5/).
|
||||
"""
|
||||
return _create("yolov5s", pretrained, channels, classes, autoshape, _verbose, device)
|
||||
|
||||
|
@ -438,7 +438,7 @@ def yolov5l6(pretrained=True, channels=3, classes=80, autoshape=True, _verbose=T
|
|||
```
|
||||
|
||||
Note:
|
||||
Refer to [PyTorch Hub Documentation](https://pytorch.org/hub/ultralytics_yolov5) for additional usage instructions.
|
||||
Refer to [PyTorch Hub Documentation](https://pytorch.org/hub/ultralytics_yolov5/) for additional usage instructions.
|
||||
"""
|
||||
return _create("yolov5l6", pretrained, channels, classes, autoshape, _verbose, device)
|
||||
|
||||
|
|
|
@ -1,96 +1,100 @@
|
|||
<a href="https://www.ultralytics.com/"><img src="https://raw.githubusercontent.com/ultralytics/assets/main/logo/Ultralytics_Logotype_Original.svg" width="320" alt="Ultralytics logo"></a>
|
||||
|
||||
# ClearML Integration with Ultralytics YOLOv5
|
||||
# ClearML Integration with Ultralytics YOLO
|
||||
|
||||
<img align="center" src="https://github.com/thepycoder/clearml_screenshots/raw/main/logos_dark.png#gh-light-mode-only" alt="Clear|ML"><img align="center" src="https://github.com/thepycoder/clearml_screenshots/raw/main/logos_light.png#gh-dark-mode-only" alt="Clear|ML">
|
||||
<img align="center" src="https://github.com/thepycoder/clearml_screenshots/raw/main/logos_dark.png#gh-light-mode-only" alt="ClearML"><img align="center" src="https://github.com/thepycoder/clearml_screenshots/raw/main/logos_light.png#gh-dark-mode-only" alt="ClearML">
|
||||
|
||||
## ℹ️ About ClearML
|
||||
|
||||
[ClearML](https://clear.ml/) is an [open-source](https://github.com/clearml/clearml) MLOps platform designed to streamline your machine learning workflow and save valuable time ⏱️. Integrating ClearML with [Ultralytics YOLOv5](https://docs.ultralytics.com/models/yolov5/) allows you to leverage a powerful suite of tools:
|
||||
[ClearML](https://clear.ml/) is an [open-source MLOps platform](https://github.com/clearml/clearml) designed to streamline your machine learning workflow and maximize productivity. Integrating ClearML with [Ultralytics YOLO](https://docs.ultralytics.com/models/yolov5/) unlocks a robust suite of tools for experiment tracking, data management, and scalable deployment:
|
||||
|
||||
- **Experiment Management:** 🔨 Track every YOLOv5 [training run](https://docs.ultralytics.com/modes/train/), including parameters, metrics, and outputs. See the [Ultralytics ClearML integration guide](https://docs.ultralytics.com/integrations/clearml/) for more details.
|
||||
- **Data Versioning:** 🔧 Version and easily access your custom training data using the integrated ClearML Data Versioning Tool, similar to concepts in [DVC integration](https://docs.ultralytics.com/integrations/dvc/).
|
||||
- **Remote Execution:** 🔦 [Remotely train and monitor](https://docs.ultralytics.com/hub/cloud-training/) your YOLOv5 models using ClearML Agent.
|
||||
- **Hyperparameter Optimization:** 🔬 Achieve optimal [Mean Average Precision (mAP)](https://docs.ultralytics.com/guides/yolo-performance-metrics/) using ClearML's [Hyperparameter Optimization](https://docs.ultralytics.com/guides/hyperparameter-tuning/) capabilities.
|
||||
- **Model Deployment:** 🔭 Turn your trained YOLOv5 model into an API with just a few commands using ClearML Serving, complementing [Ultralytics deployment options](https://docs.ultralytics.com/guides/model-deployment-options/).
|
||||
- **Experiment Management:** Effortlessly track every [YOLO training run](https://docs.ultralytics.com/modes/train/), including parameters, metrics, and outputs. Explore the [Ultralytics ClearML integration guide](https://docs.ultralytics.com/integrations/clearml/) for step-by-step instructions.
|
||||
- **Data Versioning:** Manage and access your custom training data with ClearML's Data Versioning Tool, similar to [DVC integration](https://docs.ultralytics.com/integrations/dvc/).
|
||||
- **Remote Execution:** [Remotely train and monitor models](https://docs.ultralytics.com/hub/cloud-training/) using ClearML Agent for seamless scaling.
|
||||
- **Hyperparameter Optimization:** Boost your [mean average precision (mAP)](https://docs.ultralytics.com/guides/yolo-performance-metrics/) with ClearML's [hyperparameter tuning](https://docs.ultralytics.com/guides/hyperparameter-tuning/) capabilities.
|
||||
- **Model Deployment:** Deploy your trained YOLO model as an API with ClearML Serving, complementing [Ultralytics model deployment options](https://docs.ultralytics.com/guides/model-deployment-options/).
|
||||
|
||||
You can choose to use only the experiment manager or combine multiple tools into a comprehensive [MLOps](https://www.ultralytics.com/glossary/machine-learning-operations-mlops) pipeline.
|
||||
You can use ClearML's experiment manager alone or combine these features into a comprehensive [MLOps pipeline](https://www.ultralytics.com/glossary/machine-learning-operations-mlops).
|
||||
|
||||

|
||||
|
||||
## 🦾 Setting Things Up
|
||||
## 🦾 Setting Up ClearML
|
||||
|
||||
ClearML requires communication with a server to track experiments and data. You have two main options:
|
||||
ClearML requires a server to track experiments and data. You have two main options:
|
||||
|
||||
1. **ClearML Hosted Service:** Sign up for a free account at [app.clear.ml](https://app.clear.ml/).
|
||||
2. **Self-Hosted Server:** Set up your own ClearML server. Find instructions [here](https://clear.ml/docs/latest/docs/deploying_clearml/clearml_server). The server is also open-source, ensuring data privacy.
|
||||
1. **ClearML Hosted Service:** Sign up for a free account at [app.clear.ml](https://app.clear.ml/).
|
||||
2. **Self-Hosted Server:** Deploy your own ClearML server using the [official setup guide](https://clear.ml/docs/latest/docs/deploying_clearml/clearml_server). The server is open-source, ensuring data privacy and control.
|
||||
|
||||
Follow these steps to get started:
|
||||
To get started:
|
||||
|
||||
1. Install the `clearml` Python package:
|
||||
1. **Install the ClearML Python package:**
|
||||
|
||||
```bash
|
||||
pip install clearml
|
||||
```
|
||||
```bash
|
||||
pip install clearml
|
||||
```
|
||||
|
||||
_Note: This package is included in the `requirements.txt` of YOLOv5._
|
||||
_Note: The `clearml` package is included in the YOLO requirements._
|
||||
|
||||
2. Connect the ClearML SDK to your server. [Create credentials](https://app.clear.ml/settings/workspace-configuration) (Settings -> Workspace -> Create new credentials), then run the following command and follow the prompts:
|
||||
```bash
|
||||
clearml-init
|
||||
```
|
||||
2. **Connect the ClearML SDK to your server:**
|
||||
[Create credentials](https://app.clear.ml/settings/workspace-configuration) (Settings → Workspace → Create new credentials), then run:
|
||||
|
||||
That's it! You're ready to integrate ClearML with your YOLOv5 projects 😎. For a general Ultralytics setup, see the [Quickstart Guide](https://docs.ultralytics.com/quickstart/).
|
||||
```bash
|
||||
clearml-init
|
||||
```
|
||||
|
||||
## 🚀 Training YOLOv5 With ClearML
|
||||
Follow the prompts to complete setup.
|
||||
|
||||
ClearML experiment tracking is automatically enabled when the `clearml` package is installed. Every YOLOv5 [training run](https://docs.ultralytics.com/modes/train/) will be captured and stored in the ClearML experiment manager.
|
||||
For a general Ultralytics setup, see the [Quickstart Guide](https://docs.ultralytics.com/quickstart/).
|
||||
|
||||
To customize the project or task name in ClearML, use the `--project` and `--name` arguments when running `train.py`. By default, the project is `YOLOv5` and the task is `Training`. Note that ClearML uses `/` as a delimiter for subprojects.
|
||||
## 🚀 Training YOLO with ClearML
|
||||
|
||||
When the `clearml` package is installed, experiment tracking is automatically enabled for every [YOLO training run](https://docs.ultralytics.com/modes/train/). All experiment details are captured and stored in the ClearML experiment manager.
|
||||
|
||||
To customize your project or task name in ClearML, use the `--project` and `--name` arguments. By default, the project is `YOLO` and the task is `Training`. ClearML uses `/` as a delimiter for subprojects.
|
||||
|
||||
**Example Training Command:**
|
||||
|
||||
```bash
|
||||
# Train YOLOv5s on COCO128 dataset for 3 epochs
|
||||
# Train YOLO on COCO128 dataset for 3 epochs
|
||||
python train.py --img 640 --batch 16 --epochs 3 --data coco128.yaml --weights yolov5s.pt --cache
|
||||
```
|
||||
|
||||
**Example with Custom Project and Task Names:**
|
||||
|
||||
```bash
|
||||
# Train with custom names
|
||||
# Train with custom project and experiment names
|
||||
python train.py --project my_yolo_project --name experiment_001 --img 640 --batch 16 --epochs 3 --data coco128.yaml --weights yolov5s.pt --cache
|
||||
```
|
||||
|
||||
ClearML automatically captures comprehensive information about your training run:
|
||||
ClearML automatically logs:
|
||||
|
||||
- Source code and uncommitted changes
|
||||
- Installed Python packages
|
||||
- Hyperparameters and configuration settings
|
||||
- Model checkpoints (use `--save-period n` to save every `n` epochs)
|
||||
- Console output logs
|
||||
- Performance metrics (mAP_0.5, mAP_0.5:0.95, [precision, recall](https://docs.ultralytics.com/guides/yolo-performance-metrics/), [losses](https://docs.ultralytics.com/reference/utils/loss/), [learning rates](https://www.ultralytics.com/glossary/learning-rate), etc.)
|
||||
- System details (machine specs, runtime, creation date)
|
||||
- Generated plots (e.g., label correlogram, [confusion matrix](https://www.ultralytics.com/glossary/confusion-matrix))
|
||||
- Performance metrics ([precision, recall](https://docs.ultralytics.com/guides/yolo-performance-metrics/), [losses](https://docs.ultralytics.com/reference/utils/loss/), [learning rates](https://www.ultralytics.com/glossary/learning-rate), mAP<sub>0.5</sub>, mAP<sub>0.5:0.95</sub>)
|
||||
- System details (hardware specs, runtime, creation date)
|
||||
- Generated plots (label correlogram, [confusion matrix](https://www.ultralytics.com/glossary/confusion-matrix))
|
||||
- Images with bounding boxes per epoch
|
||||
- Mosaic augmentation previews per epoch
|
||||
- Validation images per epoch
|
||||
|
||||
This wealth of information 🤯 can be visualized in the ClearML UI. You can customize table views, sort experiments by metrics like mAP, and directly compare multiple runs. This detailed tracking enables advanced features like hyperparameter optimization and remote execution.
|
||||
All this information can be visualized in the ClearML UI. You can customize table views, sort experiments by metrics, and compare multiple runs. This enables advanced features like hyperparameter optimization and remote execution.
|
||||
|
||||
## 🔗 Dataset Version Management
|
||||
|
||||
Versioning your [datasets](https://docs.ultralytics.com/datasets/) separately from code is crucial for reproducibility and collaboration. ClearML's Data Versioning Tool helps manage this process. YOLOv5 supports using ClearML dataset version IDs, automatically downloading the data if needed. The dataset ID used is saved as a task parameter, ensuring you always know which data version was used for each experiment.
|
||||
Versioning your [datasets](https://docs.ultralytics.com/datasets/) independently from code is essential for reproducibility and collaboration. ClearML's Data Versioning Tool streamlines this process. YOLO supports ClearML dataset version IDs, automatically downloading data as needed. The dataset ID is saved as a task parameter, ensuring traceability for every experiment.
|
||||
|
||||

|
||||
|
||||
### Prepare Your Dataset
|
||||
|
||||
YOLOv5 uses [YAML](https://www.ultralytics.com/glossary/yaml) files to define dataset configurations. By default, datasets are expected in the `../datasets` directory relative to the repository root. For example, the [COCO128 dataset](https://docs.ultralytics.com/datasets/detect/coco128/) structure looks like this:
|
||||
YOLO uses [YAML files](https://www.ultralytics.com/glossary/yaml) to define dataset configurations. By default, datasets are expected in the `../datasets` directory relative to the repository root. For example, the [COCO128 dataset](https://docs.ultralytics.com/datasets/detect/coco128/) structure:
|
||||
|
||||
```
|
||||
../
|
||||
├── yolov5/ # Your YOLOv5 repository clone
|
||||
├── yolov5/ # Your YOLO repository clone
|
||||
└── datasets/
|
||||
└── coco128/
|
||||
├── images/
|
||||
|
@ -101,7 +105,7 @@ YOLOv5 uses [YAML](https://www.ultralytics.com/glossary/yaml) files to define da
|
|||
|
||||
Ensure your custom dataset follows a similar structure.
|
||||
|
||||
Next, ⚠️**copy the corresponding dataset `.yaml` file into the root of your dataset folder**⚠️. This file contains essential information (`path`, `train`, `test`, `val`, `nc`, `names`) that ClearML needs.
|
||||
Next, ⚠️ **copy the corresponding dataset `.yaml` file into the root of your dataset folder**. This file contains essential information (`path`, `train`, `test`, `val`, `nc`, `names`) required by ClearML.
|
||||
|
||||
```
|
||||
../
|
||||
|
@ -116,18 +120,18 @@ Next, ⚠️**copy the corresponding dataset `.yaml` file into the root of your
|
|||
|
||||
### Upload Your Dataset
|
||||
|
||||
Navigate to your dataset's root directory in the terminal and use the `clearml-data` CLI tool to upload it:
|
||||
Navigate to your dataset's root directory and use the `clearml-data` CLI tool:
|
||||
|
||||
```bash
|
||||
cd ../datasets/coco128
|
||||
clearml-data sync --project YOLOv5_Datasets --name coco128 --folder .
|
||||
clearml-data sync --project YOLO_Datasets --name coco128 --folder .
|
||||
```
|
||||
|
||||
Alternatively, you can use the following commands:
|
||||
Alternatively, use the following commands:
|
||||
|
||||
```bash
|
||||
# Create a new dataset entry in ClearML
|
||||
clearml-data create --project YOLOv5_Datasets --name coco128
|
||||
clearml-data create --project YOLO_Datasets --name coco128
|
||||
|
||||
# Add the dataset files (use '.' for the current directory)
|
||||
clearml-data add --files .
|
||||
|
@ -140,7 +144,7 @@ _Tip: Use `--parent <parent_dataset_id>` with `clearml-data create` to link vers
|
|||
|
||||
### Run Training Using a ClearML Dataset
|
||||
|
||||
Once your dataset is versioned in ClearML, you can easily use it for training by providing the dataset ID via the `--data` argument with the `clearml://` prefix:
|
||||
Once your dataset is versioned in ClearML, you can use it for training by providing the dataset ID via the `--data` argument with the `clearml://` prefix:
|
||||
|
||||
```bash
|
||||
# Replace YOUR_DATASET_ID with the actual ID from ClearML
|
||||
|
@ -149,9 +153,9 @@ python train.py --img 640 --batch 16 --epochs 3 --data clearml://YOUR_DATASET_ID
|
|||
|
||||
## 👀 Hyperparameter Optimization
|
||||
|
||||
With experiments and data versioned, you can leverage ClearML for [Hyperparameter Optimization (HPO)](https://docs.ultralytics.com/guides/hyperparameter-tuning/). Since ClearML captures all necessary information (code, packages, environment), experiments are fully reproducible. ClearML's HPO tools clone an existing experiment, modify its hyperparameters, and automatically rerun it.
|
||||
With experiments and data versioned, you can leverage ClearML for [hyperparameter optimization](https://docs.ultralytics.com/guides/hyperparameter-tuning/). ClearML captures all necessary information (code, packages, environment), making experiments fully reproducible. Its HPO tools clone an existing experiment, modify hyperparameters, and rerun it automatically.
|
||||
|
||||
To run HPO locally, use the provided script `utils/loggers/clearml/hpo.py`. You'll need the ID of a previously run training task (the "template task") to clone. Update the script with this ID and run it.
|
||||
To run HPO locally, use the provided script `utils/loggers/clearml/hpo.py`. You'll need the ID of a previously run training task (the "template task") to clone. Update the script with this ID and run:
|
||||
|
||||
```bash
|
||||
# Install Optuna for advanced optimization strategies (optional)
|
||||
|
@ -161,23 +165,23 @@ To run HPO locally, use the provided script `utils/loggers/clearml/hpo.py`. You'
|
|||
python utils/loggers/clearml/hpo.py
|
||||
```
|
||||
|
||||
The script uses [Optuna](https://optuna.org/) by default if installed; otherwise, it falls back to `RandomSearch`. You can modify `task.execute_locally()` to `task.execute()` in the script to enqueue the HPO tasks for a remote ClearML agent.
|
||||
The script uses [Optuna](https://optuna.org/) by default if installed, or falls back to `RandomSearch`. You can modify `task.execute_locally()` to `task.execute()` in the script to enqueue HPO tasks for a remote ClearML agent.
|
||||
|
||||

|
||||
|
||||
## 🤯 Remote Execution (Advanced)
|
||||
|
||||
ClearML Agent allows you to execute experiments on remote machines (e.g., powerful on-site servers, cloud GPUs like [AWS](https://aws.amazon.com/), [GCP](https://cloud.google.com/), or [Azure](https://azure.microsoft.com/)). The agent listens to task queues, reproduces the experiment environment, runs the task, and reports results back to the ClearML server.
|
||||
ClearML Agent enables you to execute experiments on remote machines, including on-premise servers or cloud GPUs such as [AWS](https://aws.amazon.com/), [Google Cloud](https://cloud.google.com/), or [Azure](https://azure.microsoft.com/). The agent listens to task queues, reproduces the experiment environment, runs the task, and reports results back to the ClearML server.
|
||||
|
||||
Learn more about ClearML Agent:
|
||||
|
||||
- [YouTube Introduction](https://www.youtube.com/watch?v=MX3BrXnaULs)
|
||||
- [Official Documentation](https://clear.ml/docs/latest/docs/clearml_agent)
|
||||
- [YouTube Introduction to ClearML Agent](https://www.youtube.com/watch?v=MX3BrXnaULs)
|
||||
- [Official ClearML Agent Documentation](https://clear.ml/docs/latest/docs/clearml_agent)
|
||||
|
||||
Turn any machine into a ClearML agent by running:
|
||||
|
||||
```bash
|
||||
# Replace QUEUES_TO_LISTEN_TO with the name(s) of your queue(s)
|
||||
# Replace QUEUES_TO_LISTEN_TO with your queue name(s)
|
||||
clearml-agent daemon --queue QUEUES_TO_LISTEN_TO [--docker] # Use --docker to run in a Docker container
|
||||
```
|
||||
|
||||
|
@ -185,15 +189,15 @@ clearml-agent daemon --queue QUEUES_TO_LISTEN_TO [--docker] # Use --docker to ru
|
|||
|
||||
You can manage remote execution directly from the ClearML web UI:
|
||||
|
||||
1. **Clone:** Right-click an existing experiment to clone it.
|
||||
2. **Edit:** Modify hyperparameters or other settings as needed in the cloned task.
|
||||
3. **Enqueue:** Right-click the modified task and select "Enqueue" to assign it to a specific queue for an agent to pick up.
|
||||
1. **Clone:** Right-click an existing experiment to clone it.
|
||||
2. **Edit:** Modify hyperparameters or other settings in the cloned task.
|
||||
3. **Enqueue:** Right-click the modified task and select "Enqueue" to assign it to a specific queue for an agent to pick up.
|
||||
|
||||

|
||||
|
||||
### Executing a Task Remotely via Code
|
||||
|
||||
Alternatively, you can modify your training script to automatically enqueue tasks for remote execution. Add `task.execute_remotely()` after the ClearML logger is initialized in `train.py`:
|
||||
You can also modify your training script to automatically enqueue tasks for remote execution. Add `task.execute_remotely()` after the ClearML logger is initialized in `train.py`:
|
||||
|
||||
```python
|
||||
# Inside train.py, after logger initialization...
|
||||
|
@ -213,7 +217,7 @@ Running the script with this modification will package the code and its environm
|
|||
|
||||
### Autoscaling Workers
|
||||
|
||||
ClearML also provides Autoscalers that automatically manage cloud resources (AWS, GCP, Azure). They spin up new virtual machines and configure them as ClearML agents when tasks appear in a queue, then shut them down when the queue is empty, optimizing cost.
|
||||
ClearML provides Autoscalers that automatically manage cloud resources (AWS, GCP, Azure). They spin up new virtual machines as ClearML agents when tasks appear in a queue, and shut them down when the queue is empty, optimizing cost.
|
||||
|
||||
Watch the Autoscalers getting started video:
|
||||
|
||||
|
@ -221,4 +225,8 @@ Watch the Autoscalers getting started video:
|
|||
|
||||
## 🤝 Contributing
|
||||
|
||||
Contributions to enhance the ClearML integration are welcome! Please see the [Ultralytics Contributing Guide](https://docs.ultralytics.com/help/contributing/) for more information on how to get involved.
|
||||
Contributions to enhance the ClearML integration are welcome! Please see the [Ultralytics Contributing Guide](https://docs.ultralytics.com/help/contributing/) for details on how to get involved.
|
||||
|
||||
---
|
||||
|
||||
[](https://github.com/ultralytics/ultralytics/graphs/contributors)
|
||||
|
|
|
@ -2,23 +2,28 @@
|
|||
|
||||
<img src="https://cdn.comet.ml/img/notebook_logo.png">
|
||||
|
||||
# Using Ultralytics YOLOv5 with Comet
|
||||
# Using Ultralytics YOLO With Comet
|
||||
|
||||
Welcome to the guide on integrating [Ultralytics YOLOv5](https://github.com/ultralytics/yolov5) with [Comet](https://www.comet.com/site/)! Comet provides powerful tools for experiment tracking, model management, and visualization, enhancing your [machine learning](https://www.ultralytics.com/glossary/machine-learning-ml) workflow. This document details how to leverage Comet to monitor training, log results, manage datasets, and optimize hyperparameters for your YOLOv5 models.
|
||||
Welcome to the guide for integrating [Ultralytics YOLO](https://github.com/ultralytics/yolov5) with [Comet](https://www.comet.com/site/)! Comet offers robust experiment tracking, model management, and visualization tools to enhance your [machine learning](https://www.ultralytics.com/glossary/machine-learning-ml) workflow. This guide explains how to leverage Comet for monitoring training, logging results, managing datasets, and optimizing hyperparameters for your YOLO models.
|
||||
|
||||
[](https://github.com/ultralytics/velocity/actions/workflows/format.yml)
|
||||
[](https://discord.com/invite/ultralytics)
|
||||
[](https://community.ultralytics.com/)
|
||||
[](https://reddit.com/r/ultralytics)
|
||||
|
||||
## 🧪 About Comet
|
||||
|
||||
[Comet](https://www.comet.com/site/) builds tools that help data scientists, engineers, and team leaders accelerate and optimize machine learning and [deep learning](https://www.ultralytics.com/glossary/deep-learning-dl) models.
|
||||
[Comet](https://www.comet.com/site/) provides tools for data scientists, engineers, and teams to accelerate and optimize [deep learning](https://www.ultralytics.com/glossary/deep-learning-dl) and machine learning models.
|
||||
|
||||
Track and visualize model metrics in real-time, save your [hyperparameters](https://docs.ultralytics.com/guides/hyperparameter-tuning/), datasets, and model checkpoints, and visualize your model predictions with Comet Custom Panels! Comet ensures you never lose track of your work and makes it easy to share results and collaborate across teams of all sizes. Find more information in the [Comet Documentation](https://www.comet.com/docs/v2/).
|
||||
With Comet, you can track and visualize model metrics in real time, save [hyperparameters](https://docs.ultralytics.com/guides/hyperparameter-tuning/), datasets, and model checkpoints, and visualize predictions using Custom Panels. Comet ensures you never lose track of your work and makes sharing results and collaborating across teams seamless. For more details, see the [Comet Documentation](https://www.comet.com/docs/v2/).
|
||||
|
||||
## 🚀 Getting Started
|
||||
|
||||
Follow these steps to set up Comet for your YOLOv5 projects.
|
||||
Follow these steps to set up Comet for your YOLO projects.
|
||||
|
||||
### Install Comet
|
||||
|
||||
Install the necessary [Python package](https://pypi.org/project/comet-ml/) using pip:
|
||||
Install the [comet_ml Python package](https://pypi.org/project/comet-ml/) using pip:
|
||||
|
||||
```shell
|
||||
pip install comet_ml
|
||||
|
@ -28,42 +33,45 @@ pip install comet_ml
|
|||
|
||||
You can configure Comet in two ways:
|
||||
|
||||
1. **Environment Variables:** Set your credentials directly in your environment.
|
||||
1. **Environment Variables:**
|
||||
Set your credentials directly in your environment.
|
||||
|
||||
```shell
|
||||
export COMET_API_KEY=<Your Comet API Key>
|
||||
export COMET_PROJECT_NAME=<Your Comet Project Name> # Defaults to 'yolov5' if not set
|
||||
```
|
||||
```shell
|
||||
export COMET_API_KEY=<Your Comet API Key>
|
||||
export COMET_PROJECT_NAME=<Your Comet Project Name> # Defaults to 'yolov5' if not set
|
||||
```
|
||||
|
||||
Find your API key in your [Comet Account Settings](https://www.comet.com/).
|
||||
Find your API key in your [Comet Account Settings](https://www.comet.com/site/).
|
||||
|
||||
2. **Configuration File:** Create a `.comet.config` file in your working directory with the following content:
|
||||
```ini
|
||||
[comet]
|
||||
api_key=<Your Comet API Key>
|
||||
project_name=<Your Comet Project Name> # Defaults to 'yolov5' if not set
|
||||
```
|
||||
2. **Configuration File:**
|
||||
Create a `.comet.config` file in your working directory:
|
||||
|
||||
```ini
|
||||
[comet]
|
||||
api_key=<Your Comet API Key>
|
||||
project_name=<Your Comet Project Name> # Defaults to 'yolov5' if not set
|
||||
```
|
||||
|
||||
### Run the Training Script
|
||||
|
||||
Execute the YOLOv5 [training script](https://docs.ultralytics.com/modes/train/). Comet will automatically start logging your run.
|
||||
Run the YOLO [training script](https://docs.ultralytics.com/modes/train/). Comet will automatically log your run.
|
||||
|
||||
```shell
|
||||
# Train YOLOv5s on COCO128 for 5 epochs
|
||||
# Train YOLO on COCO128 for 5 epochs
|
||||
python train.py --img 640 --batch 16 --epochs 5 --data coco128.yaml --weights yolov5s.pt
|
||||
```
|
||||
|
||||
That's it! Comet automatically logs hyperparameters, command-line arguments, and training/validation metrics. Visualize and analyze your runs in the Comet UI. For more details on training, see the [Ultralytics Training documentation](https://docs.ultralytics.com/modes/train/).
|
||||
Comet automatically logs hyperparameters, command-line arguments, and training/validation metrics. Visualize and analyze your runs in the Comet UI. For more details, see the [Ultralytics training documentation](https://docs.ultralytics.com/modes/train/).
|
||||
|
||||
<img width="1920" alt="Comet UI showing YOLOv5 training metrics" src="https://user-images.githubusercontent.com/26833433/202851203-164e94e1-2238-46dd-91f8-de020e9d6b41.png">
|
||||
<img width="1920" alt="Comet UI showing YOLO training metrics" src="https://user-images.githubusercontent.com/26833433/202851203-164e94e1-2238-46dd-91f8-de020e9d6b41.png">
|
||||
|
||||
## ✨ Try an Example!
|
||||
|
||||
Explore a completed YOLOv5 training run tracked with Comet:
|
||||
Explore a completed YOLO training run tracked with Comet:
|
||||
|
||||
- **[View Example Run on Comet](https://www.comet.com/examples/comet-example-yolov5/a0e29e0e9b984e4a822db2a62d0cb357?experiment-tab=chart&showOutliers=true&smoothing=0&transformY=smoothing&xAxis=step&utm_source=yolov5&utm_medium=partner&utm_campaign=partner_yolov5_2022&utm_content=github_readme)**
|
||||
|
||||
Run the example yourself using this [Google Colab](https://colab.research.google.com/) Notebook:
|
||||
Run the example yourself using this [Google Colab](https://colab.research.google.com/) notebook:
|
||||
|
||||
[](https://colab.research.google.com/github/comet-ml/comet-examples/blob/master/integrations/model-training/yolov5/notebooks/Comet_and_YOLOv5.ipynb)
|
||||
|
||||
|
@ -73,20 +81,20 @@ Comet automatically logs the following information by default:
|
|||
|
||||
### Metrics
|
||||
|
||||
- **Losses:** Box Loss, Object Loss, Classification Loss (Training and Validation).
|
||||
- **Performance:** [mAP@0.5](https://www.ultralytics.com/glossary/mean-average-precision-map), mAP@0.5:0.95 (Validation). Learn more about these metrics in the [YOLO Performance Metrics guide](https://docs.ultralytics.com/guides/yolo-performance-metrics/).
|
||||
- **[Precision](https://www.ultralytics.com/glossary/precision) and [Recall](https://www.ultralytics.com/glossary/recall):** Validation data metrics.
|
||||
- **Losses:** Box Loss, Object Loss, Classification Loss (Training and Validation)
|
||||
- **Performance:** [mAP@0.5](https://www.ultralytics.com/glossary/mean-average-precision-map), mAP@0.5:0.95 (Validation). Learn more in the [YOLO Performance Metrics guide](https://docs.ultralytics.com/guides/yolo-performance-metrics/).
|
||||
- **[Precision](https://www.ultralytics.com/glossary/precision) and [Recall](https://www.ultralytics.com/glossary/recall):** Validation data metrics
|
||||
|
||||
### Parameters
|
||||
|
||||
- **Model Hyperparameters:** Configuration used for the model.
|
||||
- **Command Line Arguments:** All arguments passed via the [CLI](https://docs.ultralytics.com/usage/cli/).
|
||||
- **Model Hyperparameters:** Configuration used for the model
|
||||
- **Command Line Arguments:** All arguments passed via the [CLI](https://docs.ultralytics.com/usage/cli/)
|
||||
|
||||
### Visualizations
|
||||
|
||||
- **[Confusion Matrix](https://www.ultralytics.com/glossary/confusion-matrix):** Model predictions on validation data, useful for understanding classification performance ([Wikipedia definition](https://en.wikipedia.org/wiki/Confusion_matrix)).
|
||||
- **Curves:** PR and F1 curves across all classes.
|
||||
- **Label Correlogram:** Correlation visualization of class labels.
|
||||
- **[Confusion Matrix](https://www.ultralytics.com/glossary/confusion-matrix):** Model predictions on validation data ([Wikipedia](https://en.wikipedia.org/wiki/Confusion_matrix))
|
||||
- **Curves:** PR and F1 curves across all classes
|
||||
- **Label Correlogram:** Correlation visualization of class labels
|
||||
|
||||
## ⚙️ Advanced Configuration
|
||||
|
||||
|
@ -104,11 +112,11 @@ export COMET_LOG_BATCH_LEVEL_METRICS=true # Log training metrics per batch. Defa
|
|||
export COMET_LOG_PREDICTIONS=true # Disable prediction logging if set to false. Default: true
|
||||
```
|
||||
|
||||
Refer to the [Comet documentation](https://www.comet.com/docs/v2/) for more configuration options.
|
||||
For more configuration options, see the [Comet documentation](https://www.comet.com/docs/v2/).
|
||||
|
||||
### Logging Checkpoints with Comet
|
||||
### Logging Checkpoints With Comet
|
||||
|
||||
Model checkpoint logging to Comet is disabled by default. Enable it using the `--save-period` argument during training. This saves checkpoints to Comet at the specified epoch interval.
|
||||
Model checkpoint logging to Comet is disabled by default. Enable it using the `--save-period` argument during training to save checkpoints at the specified epoch interval.
|
||||
|
||||
```shell
|
||||
python train.py \
|
||||
|
@ -120,15 +128,15 @@ python train.py \
|
|||
--save-period 1 # Save checkpoint every epoch
|
||||
```
|
||||
|
||||
Checkpoints will appear in the "Assets & Artifacts" tab of your Comet experiment. Learn more about model management in the [Comet Model Registry documentation](https://www.comet.com/docs/v2/guides/model-registry/).
|
||||
Checkpoints will appear in the "Assets & Artifacts" tab of your Comet experiment. Learn more about model management in the [Comet Model Registry documentation](https://www.comet.com/docs/v2/guides/model-registry/using-model-registry/).
|
||||
|
||||
### Logging Model Predictions
|
||||
|
||||
By default, model predictions (images, ground truth labels, [bounding boxes](https://www.ultralytics.com/glossary/bounding-box)) for the validation set are logged. Control the logging frequency using the `--bbox_interval` argument, which specifies logging every Nth batch per epoch.
|
||||
|
||||
**Note:** The YOLOv5 validation dataloader defaults to a batch size of 32. Adjust `--bbox_interval` accordingly.
|
||||
**Note:** The YOLO validation dataloader defaults to a batch size of 32. Adjust `--bbox_interval` as needed.
|
||||
|
||||
Visualize predictions using Comet's Object Detection Custom Panel. See an [example project using the Panel here](https://www.comet.com/examples/comet-example-yolov5?shareable=YcwMiJaZSXfcEXpGOHDD12vA1&utm_source=yolov5&utm_medium=partner&utm_campaign=partner_yolov5_2022&utm_content=github_readme).
|
||||
Visualize predictions using Comet's Object Detection Custom Panel. See an [example project using the Panel](https://www.comet.com/examples/comet-example-yolov5?shareable=YcwMiJaZSXfcEXpGOHDD12vA1&utm_source=yolov5&utm_medium=partner&utm_campaign=partner_yolov5_2022&utm_content=github_readme).
|
||||
|
||||
```shell
|
||||
python train.py \
|
||||
|
@ -167,13 +175,13 @@ env COMET_LOG_PER_CLASS_METRICS=true python train.py \
|
|||
--weights yolov5s.pt
|
||||
```
|
||||
|
||||
## 💾 Dataset Management with Comet Artifacts
|
||||
## 💾 Dataset Management With Comet Artifacts
|
||||
|
||||
Use [Comet Artifacts](https://www.comet.com/docs/v2/guides/data-management/artifacts/) to version, store, and manage your datasets.
|
||||
Use [Comet Artifacts](https://www.comet.com/docs/v2/guides/artifacts/using-artifacts/) to version, store, and manage your datasets.
|
||||
|
||||
### Uploading a Dataset
|
||||
|
||||
Upload your dataset using the `--upload_dataset` flag. Ensure your dataset follows the structure described in the [Ultralytics Datasets documentation](https://docs.ultralytics.com/datasets/) and the dataset config [YAML](https://www.ultralytics.com/glossary/yaml) file matches the format of `coco128.yaml` (see the [COCO128 dataset docs](https://docs.ultralytics.com/datasets/detect/coco128/)).
|
||||
Upload your dataset using the `--upload_dataset` flag. Ensure your dataset follows the structure described in the [Ultralytics Datasets documentation](https://docs.ultralytics.com/datasets/) and that your dataset config [YAML](https://www.ultralytics.com/glossary/yaml) file matches the format of `coco128.yaml` (see the [COCO128 dataset docs](https://docs.ultralytics.com/datasets/detect/coco128/)).
|
||||
|
||||
```shell
|
||||
python train.py \
|
||||
|
@ -191,12 +199,12 @@ View the uploaded dataset in the Artifacts tab of your Comet Workspace.
|
|||
Preview data directly in the Comet UI.
|
||||
<img width="1082" alt="Comet UI previewing dataset images" src="https://user-images.githubusercontent.com/7529846/186929215-432c36a9-c109-4eb0-944b-84c2786590d6.png">
|
||||
|
||||
Artifacts are versioned and support metadata. Comet automatically logs metadata from your dataset `yaml` file.
|
||||
Artifacts are versioned and support metadata. Comet automatically logs metadata from your dataset YAML file.
|
||||
<img width="963" alt="Comet Artifact metadata view" src="https://user-images.githubusercontent.com/7529846/186929256-9d44d6eb-1a19-42de-889a-bcbca3018f2e.png">
|
||||
|
||||
### Using a Saved Artifact
|
||||
|
||||
To use a dataset stored in Comet Artifacts, update the `path` in your dataset `yaml` file to the Artifact resource URL:
|
||||
To use a dataset stored in Comet Artifacts, update the `path` in your dataset YAML file to the Artifact resource URL:
|
||||
|
||||
```yaml
|
||||
# contents of artifact.yaml
|
||||
|
@ -223,9 +231,9 @@ Artifacts track data lineage, showing which experiments used specific dataset ve
|
|||
|
||||
## 🔄 Resuming Training Runs
|
||||
|
||||
If a training run is interrupted (e.g., due to connection issues), you can resume it using the `--resume` flag with the Comet Run Path (`comet://<your_workspace>/<your_project>/<experiment_id>`).
|
||||
If a training run is interrupted (for example, due to connection issues), you can resume it using the `--resume` flag with the Comet Run Path (`comet://<your_workspace>/<your_project>/<experiment_id>`).
|
||||
|
||||
This restores the model state, hyperparameters, arguments, and downloads necessary Artifacts, continuing logging to the existing Comet Experiment. Learn more about [resuming runs in the Comet documentation](https://www.comet.com/docs/v2/guides/experiment-logging/resume-experiment/).
|
||||
This restores the model state, hyperparameters, arguments, and downloads necessary Artifacts, continuing logging to the existing Comet Experiment. Learn more about [resuming runs in the Comet documentation](https://www.comet.com/docs/v2/guides/experiment-management/resume-experiment/).
|
||||
|
||||
```shell
|
||||
python train.py \
|
||||
|
@ -234,7 +242,7 @@ python train.py \
|
|||
|
||||
## 🔍 Hyperparameter Optimization (HPO)
|
||||
|
||||
YOLOv5 integrates with the [Comet Optimizer](https://www.comet.com/docs/v2/guides/hyperparameter-optimization/) for easy hyperparameter sweeps and visualization. This helps in finding the best set of parameters for your model, a process often referred to as [Hyperparameter Tuning](https://docs.ultralytics.com/guides/hyperparameter-tuning/).
|
||||
YOLO integrates with the [Comet Optimizer](https://www.comet.com/docs/v2/guides/optimizer/configure-optimizer/) for easy hyperparameter sweeps and visualization. This helps you find the best set of parameters for your model, a process often referred to as [Hyperparameter Tuning](https://docs.ultralytics.com/guides/hyperparameter-tuning/).
|
||||
|
||||
### Configuring an Optimizer Sweep
|
||||
|
||||
|
@ -269,10 +277,10 @@ Replace `<num_workers>` with the desired number of parallel processes.
|
|||
|
||||
### Visualizing HPO Results
|
||||
|
||||
Comet offers various visualizations for analyzing sweep results, such as parallel coordinate plots and parameter importance plots. Explore a [project with a completed sweep here](https://www.comet.com/examples/comet-example-yolov5/view/PrlArHGuuhDTKC1UuBmTtOSXD/panels?utm_source=yolov5&utm_medium=partner&utm_campaign=partner_yolov5_2022&utm_content=github_readme).
|
||||
Comet offers various visualizations for analyzing sweep results, such as parallel coordinate plots and parameter importance plots. Explore a [project with a completed sweep](https://www.comet.com/examples/comet-example-yolov5/view/PrlArHGuuhDTKC1UuBmTtOSXD/panels?utm_source=yolov5&utm_medium=partner&utm_campaign=partner_yolov5_2022&utm_content=github_readme).
|
||||
|
||||
<img width="1626" alt="Comet HPO visualization" src="https://user-images.githubusercontent.com/7529846/186914869-7dc1de14-583f-4323-967b-c9a66a29e495.png">
|
||||
|
||||
## 🤝 Contributing
|
||||
|
||||
Contributions to enhance the YOLOv5-Comet integration are welcome! Please see the [Ultralytics Contributing Guide](https://docs.ultralytics.com/help/contributing/) for more information on how to get involved. Thank you for helping improve this integration!
|
||||
Contributions to enhance the YOLO-Comet integration are welcome! Please see the [Ultralytics Contributing Guide](https://docs.ultralytics.com/help/contributing/) for more information on how to get involved. Thank you for helping improve this integration!
|
||||
|
|
Loading…
Reference in New Issue