# ClearML Integration
<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">
## About ClearML
[ClearML](https://cutt.ly/yolov5-tutorial-clearml) is an [open-source](https://github.com/allegroai/clearml) toolbox designed to save you time â±ï¸.
ð¨ Track every YOLOv5 training run in the <b>experiment manager</b>
ð§ Version and easily access your custom training data with the integrated ClearML <b>Data Versioning Tool</b>
ð¦ <b>Remotely train and monitor</b> your YOLOv5 training runs using ClearML Agent
ð¬ Get the very best mAP using ClearML <b>Hyperparameter Optimization</b>
ð Turn your newly trained <b>YOLOv5 model into an API</b> with just a few commands using ClearML Serving
<br />
And so much more. It's up to you how many of these tools you want to use, you can stick to the experiment manager, or chain them all together into an impressive pipeline!
<br />
<br />
![ClearML scalars dashboard](https://github.com/thepycoder/clearml_screenshots/raw/main/experiment_manager_with_compare.gif)
<br />
<br />
## 𦾠Setting Things Up
To keep track of your experiments and/or data, ClearML needs to communicate to a server. You have 2 options to get one:
Either sign up for free to the [ClearML Hosted Service](https://cutt.ly/yolov5-tutorial-clearml) or you can set up your own server, see [here](https://clear.ml/docs/latest/docs/deploying_clearml/clearml_server). Even the server is open-source, so even if you're dealing with sensitive data, you should be good to go!
1. Install the `clearml` python package:
```bash
pip install clearml
```
2. Connect the ClearML SDK to the server by [creating credentials](https://app.clear.ml/settings/workspace-configuration) (go right top to Settings -> Workspace -> Create new credentials), then execute the command below and follow the instructions:
```bash
clearml-init
```
That's it! You're done ð
<br />
## ð Training YOLOv5 With ClearML
To enable ClearML experiment tracking, simply install the ClearML pip package.
```bash
pip install clearml>=1.2.0
```
This will enable integration with the YOLOv5 training script. Every training run from now on, will be captured and stored by the ClearML experiment manager.
If you want to change the `project_name` or `task_name`, use the `--project` and `--name` arguments of the `train.py` script, by default the project will be called `YOLOv5` and the task `Training`. PLEASE NOTE: ClearML uses `/` as a delimiter for subprojects, so be careful when using `/` in your project name!
```bash
python train.py --img 640 --batch 16 --epochs 3 --data coco128.yaml --weights yolov5s.pt --cache
```
or with custom project and task name:
```bash
python train.py --project my_project --name my_training --img 640 --batch 16 --epochs 3 --data coco128.yaml --weights yolov5s.pt --cache
```
This will capture:
- Source code + uncommitted changes
- Installed packages
- (Hyper)parameters
- Model files (use `--save-period n` to save a checkpoint every n epochs)
- Console output
- Scalars (mAP_0.5, mAP_0.5:0.95, precision, recall, losses, learning rates, ...)
- General info such as machine details, runtime, creation date etc.
- All produced plots such as label correlogram and confusion matrix
- Images with bounding boxes per epoch
- Mosaic per epoch
- Validation images per epoch
- ...
That's a lot right? 𤯠Now, we can visualize all of this information in the ClearML UI to get an overview of our training progress. Add custom columns to the table view (such as e.g. mAP_0.5) so you can easily sort on the best performing model. Or select multiple experiments and directly compare them!
There even more we can do with all of this information, like hyperparameter optimization and remote execution, so keep reading if you want to see how that works!
<br />
## ð Dataset Version Management
Versioning your data separately from your code is generally a good idea and makes it easy to acquire the latest version too. This repository supports supplying a dataset version ID, and it will make sure to get the data if it's not there yet. Next to that, this workflow also saves the used dataset ID as part of the task parameters, so you will always know for sure which data was used in which experiment!
![ClearML Dataset Interface](https://github.com/thepycoder/clearml_screenshots/raw/main/clearml_data.gif)
### Prepare Your Dataset
The YOLOv5 repository supports a number of different datasets by using yaml files containing their information. By default datasets are downloaded to the `../datasets` folder in relation to the repository root folder. So if you downloaded the `coco128` dataset using the link in the yaml or with the scripts provided by yolov5, you get this folder structure:
```
..
|_ yolov5
|_ datasets
|_ coco128
|_ images
|_ labels
|_ LICENSE
|_ README.txt
```
But this can be any dataset you wish. Feel free to use your own, as long as you keep to this folder structure.
Next, â ï¸**copy the corresponding yaml file to the root of the dataset folder**â ï¸. This yaml files contains the information ClearML will need to properly use the dataset. You can make this yourself too, of course, just follow the structure of the example yamls.
Basically we need the following keys: `path`, `train`, `test`, `val`, `nc`, `names`.
```
..
|_ yolov5
|_ datasets
|_ coco128
|_ images
|_ labels
|_ coco128.yaml # <---- HERE!
|_ LICENSE
|_ README.txt
```
### Upload Your Dataset
To get this dataset into ClearML as a versioned dataset, go to the dataset root folder and run the following command:
```bash
cd coco128
clearml-data sync --project YOLOv5 --name coco128 --folder .
```
The command `clearml-data sync` is actually a shorthand command. You could also run these commands one after the other:
```bash
# Optionally add --parent <parent_dataset_id> if you want to base
# this version on another dataset version, so no duplicate files are uploaded!
clearml-data create --name coco128 --project YOLOv5
clearml-data add --files .
clearml-data close
```
### Run Training Using A ClearML Dataset
Now that you have a ClearML dataset, you can very simply use it to train custom YOLOv5 ð models!
```bash
python train.py --img 640 --batch 16 --epochs 3 --data clearml://<your_dataset_id> --weights yolov5s.pt --cache
```
<br />
## ð Hyperparameter Optimization
Now that we have our experiments and data versioned, it's time to take a look at what we can build on top!
Using the code information, installed packages and environment details, the experiment itself is now **completely reproducible**. In fact, ClearML allows you to clone an experiment and even change its parameters. We can then just rerun it with these new parameters automatically, this is basically what HPO does!
To **run hyperparameter optimization locally**, we've included a pre-made script for you. Just make sure a training task has been run at least once, so it is in the ClearML experiment manager, we will essentially clone it and change its hyperparameters.
You'll need to fill in the ID of this `template task` in the script found at `utils/loggers/clearml/hpo.py` and then just run it :) You can change `task.execute_locally()` to `task.execute()` to put it in a ClearML queue and have a remote agent work on it instead.
```bash
# To use optuna, install it first, otherwise you can change the optimizer to just be RandomSearch
pip install optuna
python utils/loggers/clearml/hpo.py
```
![HPO](https://github.com/thepycoder/clearml_screenshots/raw/main/hpo.png)
## 𤯠Remote Execution (advanced)
Running HPO locally is really handy, but what if we want to run our experiments on a remote machine instead? Maybe you have ac
没有合适的资源?快使用搜索试试~ 我知道了~
python《基于YOLOv8目标检测技术实现智慧垃圾管理平台》+项目源码+文档说明
共167个文件
py:49个
jpg:32个
yaml:31个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 26 浏览量
2024-11-12
13:00:27
上传
评论
收藏 75.71MB ZIP 举报
温馨提示
<项目介绍> - 本项目基于YOLOv8目标检测技术开发了一套智慧垃圾管理平台,集成了垃圾分类识别、积分奖励、旧物回收、社区管理等功能。通过用户权限管理体系,平台能够自动识别用户投放的垃圾种类,记录垃圾分类行为并根据表现给予相应的积分或处罚。回收员与管理员可管理社区垃圾处理和旧物回收流程,监督垃圾分类情况并维护积分商城,实现垃圾分类智能化、旧物回收便捷化,提升社区环保意识和管理效率。 - 不懂运行,下载完可以私聊问,可远程教学 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.md文件(如有),仅供学习参考, 切勿用于商业用途。 --------
资源推荐
资源详情
资源评论
收起资源包目录
python《基于YOLOv8目标检测技术实现智慧垃圾管理平台》+项目源码+文档说明 (167个子文件)
amaze.css 326KB
bootstrap.min.css 107KB
style.css 3KB
detection_image.css 2KB
Dockerfile 3KB
Dockerfile 821B
Dockerfile-arm64 2KB
Dockerfile-cpu 2KB
.flaskenv 21B
.gitignore 3KB
recycling.html 7KB
base.html 7KB
commodity.html 7KB
community.html 4KB
popular_science.html 4KB
community_change.html 4KB
community_add.html 4KB
popular_science_change.html 4KB
recycling_add.html 4KB
disposal.html 3KB
detect_result.html 3KB
Trash_disposal.html 3KB
popular_science_add.html 3KB
commodity_add.html 3KB
commodity_change.html 3KB
logging.html 2KB
blacklist.html 2KB
login.html 2KB
popular_science_instance.html 2KB
user_role.html 2KB
Trash_detect.html 1KB
disposal_trash.html 1KB
index.html 962B
404.html 245B
500.html 244B
400.html 244B
3.jpg 1.1MB
2.jpg 1004KB
1.jpg 932KB
20210000310.jpg 573KB
20210000232.jpg 362KB
20210000319.jpg 206KB
20210000242.jpg 205KB
20210000192.jpg 204KB
20210000131.jpg 181KB
20210000365.jpg 162KB
20210000273.jpg 151KB
20210000321.jpg 126KB
20210000169.jpg 108KB
20210000160.jpg 95KB
20210000115.jpg 92KB
20210012487.jpg 89KB
20210003444.jpg 82KB
20210001757.jpg 81KB
20210001074.jpg 66KB
20210008674.jpg 61KB
20210003389.jpg 57KB
20210009665.jpg 57KB
20210008626.jpg 51KB
20210011644.jpg 32KB
20210000116.jpg 27KB
20210004790.jpg 24KB
20210001588.jpg 19KB
20210007469.jpg 18KB
20210009108.jpg 17KB
20210007481.jpg 15KB
20210000401.jpg 14KB
20210007463.jpg 9KB
Chart.js 418KB
jquery-3.1.1.min.js 85KB
jquery.table2excel.js 10KB
recycling_up.js 2KB
load_file.js 2KB
Trash_disposal.js 2KB
optimizer_config.json 2KB
LICENSE 11KB
README.md 11KB
README.md 11KB
README.md 2KB
README.md 2KB
演示视频.mp4 65.21MB
loading01.png 3KB
best.pt 13.89MB
dataloaders.py 59KB
general.py 50KB
common.py 48KB
export.py 41KB
tf.py 31KB
views.py 23KB
torch_utils.py 21KB
__init__.py 21KB
yolo.py 20KB
plots.py 20KB
__init__.py 20KB
augmentations.py 18KB
detect.py 16KB
metrics.py 15KB
dataloaders.py 13KB
loss.py 11KB
clearml_utils.py 9KB
共 167 条
- 1
- 2
资源评论
程序员无锋
- 粉丝: 3682
- 资源: 2319
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- vi编辑器的使用沃尔沃
- 具有快速处理算法的正弦频率扫描 OFDR 分布式声学传感
- java学习资源共享平台源码数据库 MySQL源码类型 WebForm
- shiro 只提供了对 ehcache 和 parallelHashMap 的支持,下面介绍一个 shiro 可以使用的 redis cache 实现,希望对大家有帮助!.zip
- Ruby on Rails 的 Redis 存储.zip
- Resque 是一个由 Redis 支持的 Ruby 库,用于创建后台作业、将它们放在多个队列中,然后在稍后处理它们 .zip
- matlab代码展示csv文件
- JAVA的Springboot+vue在线考试系统源码 前后端分离数据库 MySQL源码类型 WebForm
- Redis、Redis Cloud 和 Redis Enterprise 文档.zip
- RedisView通过自写的RESP协议解析、自写的树模型和线程池,实现了开源、跨平台、高性能的Redis接口工具 RedisView业余爱好通过自写RESP协议解析、自写树模型、线程池实现.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功