Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Efficient Teacher's detection algorithms trained on various open source datasets
Before we proceed with semi-supervised training, we need you to convert your own model trained with the YOLOv5 open source framework into a format that we can recognize. If you are using version 6.0 or later, the process is very fast and can be completed in five minutes:

1. Convert Model
- First, you need to write a yaml file. You can directly modify the file ```configs/custom/yolov5l_custom.yaml```. If your model is yolov5l, then you only need to modify the nc in Dataset to the number of your detection classes and then modify the names. If your model is other depth and width configurations, then modify the depth_multiple and width_multiple to the corresponding configurations.
- First, you need to write a yaml file. You can directly modify the file ```configs/sup/custom/yolov5l_custom.yaml```. If your model is yolov5l, then you only need to modify the nc in Dataset to the number of your detection classes and then modify the names. If your model is other depth and width configurations, then modify the depth_multiple and width_multiple to the corresponding configurations.
- After having this yaml file, go to the scripts folder to modify the ```convert_pt_to_efficient.py```, fill in your business model pt, yaml, and the exported pt file.
- OK, you have already converted your pt file into a version that our algorithm library can recognize. Don't worry, if you need to export the model to onnx or export it back to your own YOLOv5 algorithm library, we also provide corresponding scripts.

Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Efficient Teacher算法的使用场景

感谢您选择这种稳健的方案来验证半监督训练的效果,这个方案步骤稍微多一些,但是每一步都是有基准线的,请按照以下步骤开始您的旅程:
1. 模型转换
- 首先请您查看一下```configs/custom/yolov5_custom.yaml```这份文件,如果您的模型是YOLOv5l, 那么你只需要修改yaml文件中Dataset里的nc参数,再修改一些类别名。如果您的模型结构是n/m/s/x,那么您还需要针对性地修改depth_multiple和width_multiple这两个参数
- 首先请您查看一下```configs/sup/custom/yolov5_custom.yaml```这份文件,如果您的模型是YOLOv5l, 那么你只需要修改yaml文件中Dataset里的nc参数,再修改一些类别名。如果您的模型结构是n/m/s/x,那么您还需要针对性地修改depth_multiple和width_multiple这两个参数
- 接着请您来到scripts文件夹下面修改```convert_pt_to_efficient.py```这份文件,填上您使用标准或魔改的YOLOv5代码训练出的模型pt, 再填上你修改后的yolov5_custom.yaml的绝对路径,还有你希望导出的模型放置位置
- 如果上述操作没有报错的话,您现在已经获得了一份可以在efficientteacher库中运行的模型了,不用担心,我们的代码库也提供导回您自己算法库和导出为onnx的方案,确保您原来的开发工作流尽量不被干扰

Expand Down
2 changes: 1 addition & 1 deletion detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def run(weights=ROOT / 'yolov5s.pt', # model.pt path(s)
save_img = not nosave # save inference images
webcam = source.isnumeric() or source.endswith('.txt') or source.lower().startswith(
('rtsp://', 'rtmp://', 'http://', 'https://'))
webcam = False

# Directories
save_dir = increment_path(Path(project) / name, exist_ok=exist_ok) # increment run
(save_dir / 'labels' if save_txt else save_dir).mkdir(parents=True, exist_ok=True) # make dir
Expand Down