From 5876b7ec88efbe54a21c1ba819d0fa623a8c5721 Mon Sep 17 00:00:00 2001 From: zhangtao Date: Thu, 2 Mar 2023 11:59:41 +0800 Subject: [PATCH 1/2] fix "source 0" error --- detect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detect.py b/detect.py index 9a5e74b..ffa75b6 100755 --- a/detect.py +++ b/detect.py @@ -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 From 291196f0fbaff0380cb11361c2b769c3a28a3c7d Mon Sep 17 00:00:00 2001 From: sunmooncode Date: Thu, 2 Mar 2023 14:32:27 +0800 Subject: [PATCH 2/2] fix readme --- README.md | 2 +- README.zh-CN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 42bb9d8..ce2f0f8 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/README.zh-CN.md b/README.zh-CN.md index f3584c6..38ef160 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -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的方案,确保您原来的开发工作流尽量不被干扰