Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use other yolov5 models #5

Open
ramdhan1989 opened this issue Sep 27, 2022 · 5 comments
Open

use other yolov5 models #5

ramdhan1989 opened this issue Sep 27, 2022 · 5 comments

Comments

@ramdhan1989
Copy link

Hi, I wonder if I can use other yolov5 model (n,s,m,l,etc)? I have tried to use DRENet.yaml inside models folder. is it possible to use yaml file from yolov5 repo? do I need to do some modification?

please advise

thanks

@WindVChen
Copy link
Owner

WindVChen commented Sep 28, 2022

Hi, actually I have not tried to apply DRENet with larger backbone than YOLOv5s previously. But if you want to, it is very easy. Just change the depth_multiple and width_multiple in the .yaml to apply which size model you want, these two params just corresponds to the number of layers and the channels of each module. You can refer to the yamls in YOLOv5 official repo and the usage of these two params in the code for more details.

Furthermore, for large model, you may need to try different number of C3ResAtnMHSA layers in the yaml for a better result. Current for YOLOv5s is 1 = 3 * 0.33.

@ramdhan1989
Copy link
Author

it is the one on the backbone, isn't it? would you mind elaborating more on how to add the C3ResAtnMHSA layer? do I need to change the value of three (red line) only? is there any rule of thumb to add this layer? due to my computer capacity, I am going to use yolov5l.

image

please advise,

thank you

@WindVChen
Copy link
Owner

For applying different size of YOLOv5, such as YOLOv5m, YOLOv5l, etc., you only need to change these two params in DRENet.yaml:
image

E.g., YOLOv5s is 0.33 and 0.5 respectively, YOLOv5m is 0.67 and 0.75, etc. You can refer to more details in Yolov5 official Repo. Then, you have applied DRENet with different size of YOLOv5.

About the number of C3ResAtnMHSA, for the current configuration, it is 1 = 3 (the value denoted with redline in your figure) * 0.33 (depth_multiple of YOLOv5s). If you change the depth_multiple to 1.0 (Configuration of YOLOv5l), the number of C3ResAtnMHSA layers will go to 3. You can just try whether 3 layers C3ResAtnMHSA can get good results. Or maybe only 1 is enough (then you may need to set the redlined value 3 to 1). You also should note that there are 5 C3ResAtnMHSA in the yaml, you may need to modify then together.
image

@ramdhan1989
Copy link
Author

Hi @WindVChen thank you so much for your help. I think your method works better in my dataset as compared to original yolov5 implementation. Can I use this repo for further implementation ? or may be to use it in data science competition?

thank you

@WindVChen
Copy link
Owner

I'm glad that the method can help. Just feel free to use it as long as the source is indicated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants