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

Update VariFocal Loss Function #1541

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Update VariFocal Loss Function #1541

wants to merge 5 commits into from

Conversation

Sangh0
Copy link

@Sangh0 Sangh0 commented Feb 28, 2023

I added vari focal loss function in utils/loss.py
Also, I added other some codes to calculate vari focal loss.
I experimented with vari focal loss, its performance is so good.
So,I want you refer to this PR.
Thank you.

@xoxograce15
Copy link

@Sangh0 So how do i ensure that my program is using varifocalloss function? What changes do I need to do, inorder for me to utilize varifocal and not CIOU, DIOU, etc. as in #1721 (comment)
If you could please help me, I'd be very grateful. Thanks

@Sangh0
Copy link
Author

Sangh0 commented Jul 26, 2023

@xoxograce15 Varifocal loss is a classification loss and not bounding box loss. If you want to train model with varifocal loss, you need to implement varifocal loss. Also, if you need references, visiting my repository

@xoxograce15
Copy link

Thank you for your reply. Yes, I want to train model with varifocal loss, but how exactly are you suggesting me to "implement varifocal loss". I didn't get you. Like, do i need to do some changes in the loss.py or how?
I am already following the repository you linked https://github.com/Sangh0/yolov7_varifocal
Any information would be very helpful for my research work as I am working around this topic so. Thanks <3

@Sangh0
Copy link
Author

Sangh0 commented Jul 28, 2023

@xoxograce15 Sure, here varifocal loss in loss.py is the codes that you want. The code from line 177 to line 229 and line 498 is for varifocal loss.

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

Successfully merging this pull request may close these issues.

None yet

2 participants