Przeglądaj źródła

add iclab for imagenet pretraining

yjh0410 1 rok temu
rodzic
commit
895b6ed654
2 zmienionych plików z 13 dodań i 7 usunięć
  1. 4 0
      README.md
  2. 9 7
      yolo/README.md

+ 4 - 0
README.md

@@ -64,6 +64,10 @@
 | YOLOF_R18_C5_1x  |  800,1333  |          54          |          32.8          |       51.4        | [ckpt](https://github.com/yjh0410/YOLO-Tutorial-v2/releases/download/yolo_tutorial_ckpt/yolof_r18_c5_1x_coco.pth) | [log](https://github.com/yjh0410/YOLO-Tutorial-v2/releases/download/yolo_tutorial_ckpt/YOLOF-R18-C5-1x.txt) |
 | YOLOF_R50_C5_1x  |  800,1333  |          21          |          37.7          |       57.2        | [ckpt](https://github.com/yjh0410/YOLO-Tutorial-v2/releases/download/yolo_tutorial_ckpt/yolof_r50_c5_1x_coco.pth) | [log](https://github.com/yjh0410/YOLO-Tutorial-v2/releases/download/yolo_tutorial_ckpt/YOLOF-R50-C5-1x.txt) |
 
+### ICLab系列
+本项目的`iclab/`文件夹则是用于预训练主干网络的,例如本书所介绍的YOLOv3和YOLOv4的主干网络、YOLOv5和YOLOv8的主干网络等,虽然本书主讲视觉目标检测,但预训练时至今日也还是比较重要的一项技术,因此,我们还是提供了预训练的代码,以便读者根据自己的兴趣去尝试预训练某些主干网络。对于这个文件夹,我们就不做过多介绍了,毕竟不是本书的重点,且视觉分类任务太基础也太简单了,已经是入门深度学习的基本功了,相信读者都或多或少有些基础了。
+
+------------- 以下是英文文档 -------------
 
 # The source code of the second edition of the book "YOLO Object Detection"
 This project is the source code of the "YOLO Target Detection" book (second edition), which includes all YOLO models, RT-DETR models, DETR models, FCOS models, and YOLOF models involved in this book. For YOLO and RT-DETR, readers can find all source codes in the `yolo/` folder of the project; for DETR, FCOS and YOLOF models, readers can find all source codes in the `odlab/` folder of the project. 

+ 9 - 7
yolo/README.md

@@ -193,8 +193,7 @@ python -m torch.distributed.run --nproc_per_node 8 --master_port 1623 train.py -
                 --fp16
 ```
 
-You could add `--pretrained path/to/yolov1_r18_coco.pth` into the above command to load the coco pretrained weight as
-the initial weight, which might help with faster training convergence and improve performance on custom tasks. However, if there is a significant difference between your custom data and COCO data, this trick may not be effective. For example, if your custom data is medical images, in my opinion, the large number of natural images contained in the COCO dataset may not have any promoting effect on your task.
+在自定义数据集上训练时,也可以考虑加载COCO预训练权重,例如在命令行参数中加入 `--pretrained path/to/yolov1_r18_coco.pth`,使用COCO预训练权重通常是可以加快收敛和提升性能的,但前提得是自定义数据集和COCO数据集的分布差不多,否则可能不会起作用,例如,对于医学图像的目标检测,COCO预训练权重可能就无效了,因为COCO数据集所包含的大多都是自然世界的图像。
 
 - 第6步:使用自定义数据测试模型
 
@@ -266,7 +265,7 @@ python demo.py --mode camera \
 ```
 
 
--------------------
+------------- 以下是英文文档 -------------
 
 # Tutorial of YOLO series
 
@@ -439,15 +438,18 @@ python custom.py --root path/to/custom_dataset/ --split val
 For example:
 
 ```Shell
-# With coco pretrained weight
+# Without coco pretrained weight
 cd <YOLO-TUTORIAL-V2/yolo/>
-python train.py --root path/to/custom_dataset/ -d custom -m yolov1_r18 -bs 16 -p path/to/yolov1_r18_coco.pth
+python train.py --root path/to/custom_dataset/ -d custom -m yolov1_r18 -bs 16
 ```
 
+You could add `--pretrained path/to/yolov1_r18_coco.pth` into the above command to load the coco pretrained weight as
+the initial weight, which might help with faster training convergence and improve performance on custom tasks. However, if there is a significant difference between your custom data and COCO data, this trick may not be effective. For example, if your custom data is medical images, in my opinion, the large number of natural images contained in the COCO dataset may not have any promoting effect on your task.
+
 ```Shell
-# Without coco pretrained weight
+# With coco pretrained weight
 cd <YOLO-TUTORIAL-V2/yolo/>
-python train.py --root path/to/custom_dataset/ -d custom -m yolov1_r18 -bs 16
+python train.py --root path/to/custom_dataset/ -d custom -m yolov1_r18 -bs 16 -p path/to/yolov1_r18_coco.pth
 ```
 
 - Step-6 **Test** on the custom dataset