YuHengsss / YOLOV

This repo is an implementation of PyTorch version YOLOV Series
Apache License 2.0
283 stars 39 forks source link

How can I train the YOLOX and Feature aggregation module seperately? #4

Closed hahapt closed 1 year ago

hahapt commented 1 year ago

Hello, I'm working on if I can replace the YOLOX with YOLOv5, so I'm finding how can I train the YOLOX and Feature aggregation module seperately?

YuHengsss commented 1 year ago

For training YOLOX, you can configure files in exps/yolov/yoloxs_vid.py, download the coco pretrain model and run the script in tools/train.py to train YOLOX. Then, YOLOV, you can simply run: python tools/vid_train.py -f exps/yolov/yolov_s.py -c weights/[path to your yolox model] --fp16

YuHengsss commented 1 year ago

Hello, I'm working on if I can replace the YOLOX with YOLOv5, so I'm finding how can I train the YOLOX and Feature aggregation module seperately?

For more details on training YOLOX, please refer to https://github.com/Megvii-BaseDetection/YOLOX

hahapt commented 1 year ago

So I can train YOLOX with tools/train.py , and then train the feature aggregation module with python tools/vid_train.py -f exps/yolov/yolov_s.py -c weights/[path to your yolox model] --fp16? So how can I change the training strategies like ''When integrating the feature aggrega- tion module into the base detectors, we fine-tune them for 150K iterations with batch size of 16 on a single 2080Ti GPU''?

YuHengsss commented 1 year ago

So I can train YOLOX with tools/train.py , and then train the feature aggregation module with python tools/vid_train.py -f exps/yolov/yolov_s.py -c weights/[path to your yolox model] --fp16? So how can I change the training strategies like ''When integrating the feature aggrega- tion module into the base detectors, we fine-tune them for 150K iterations with batch size of 16 on a single 2080Ti GPU''?

Sorry, we find the coco annotation for training has the wrong path and we have updated it. For training base detector yolox, you just make a "annotations" directory in the dataset path and copy the annotation files to it or change the code in coco.py. Then, run the training script. Thanks for helping us debug.

YuHengsss commented 1 year ago

So I can train YOLOX with tools/train.py , and then train the feature aggregation module with python tools/vid_train.py -f exps/yolov/yolov_s.py -c weights/[path to your yolox model] --fp16? So how can I change the training strategies like ''When integrating the feature aggrega- tion module into the base detectors, we fine-tune them for 150K iterations with batch size of 16 on a single 2080Ti GPU''?

Hello, I'm working on if I can replace the YOLOX with YOLOv5, so I'm finding how can I train the YOLOX and Feature aggregation module seperately?

YOLOv5 is an anchor-based detector, which means you have to change the feature selection strategy. For changing the training process, please refer to our code for more details.

hahapt commented 1 year ago

So I can train YOLOX with tools/train.py , and then train the feature aggregation module with python tools/vid_train.py -f exps/yolov/yolov_s.py -c weights/[path to your yolox model] --fp16? So how can I change the training strategies like ''When integrating the feature aggrega- tion module into the base detectors, we fine-tune them for 150K iterations with batch size of 16 on a single 2080Ti GPU''?

Hello, I'm working on if I can replace the YOLOX with YOLOv5, so I'm finding how can I train the YOLOX and Feature aggregation module seperately?

YOLOv5 is an anchor-based detector, which means you have to change the feature selection strategy. For changing the training process, please refer to our code for more details.

Sorry I'm a little confuse. I think the idea of aggregate features after prediction head can be helpful, but why anchor-based detector need to change the feature selection strategy?

YuHengsss commented 1 year ago

So I can train YOLOX with tools/train.py , and then train the feature aggregation module with python tools/vid_train.py -f exps/yolov/yolov_s.py -c weights/[path to your yolox model] --fp16? So how can I change the training strategies like ''When integrating the feature aggrega- tion module into the base detectors, we fine-tune them for 150K iterations with batch size of 16 on a single 2080Ti GPU''?

Hello, I'm working on if I can replace the YOLOX with YOLOv5, so I'm finding how can I train the YOLOX and Feature aggregation module seperately?

YOLOv5 is an anchor-based detector, which means you have to change the feature selection strategy. For changing the training process, please refer to our code for more details.

Sorry I'm a little confuse. I think the idea of aggregate features after prediction head can be helpful, but why anchor-based detector need to change the feature selection strategy?

Because multiple bounding boxes may correspond to the same feature. We have not tried this practice and look forward to yours.

hahapt commented 1 year ago

Fine, I found it's not easy to directly try it on yolov5. So can you share the code based on ppyoloe?