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

valid mAP much higher than the original darknet using the same weights trained by this repo #3478

Closed
yanxurui opened this issue Jun 23, 2019 · 9 comments
Labels
Solved The problem is solved using the correct settings

Comments

@yanxurui
Copy link

Hi @AlexeyAB

I have trained this repo on a custom dataset.

I want to compute mAP on the validation set.

I run this command:
./darknet detector valid cfg/bdd.data cfg/yolov3-bdd.cfg backup/yolov3-bdd_30000.weights
Then compute the mAP using cocoapi on the result json file.
The mAP is around 16%.

I run the same command using the original darknet repo with config and weights being replaced with the same files.
The mAP is around 10%.

I also use ultralytics/yolov3 to calculate mAP which is around 10%.

So, why do the weights trained by this repo perform worse when using the original repo to do validation?

Thank you very much.

@AlexeyAB
Copy link
Owner

@yanxurui Hi,

The latest version of this repo supports 2 approaches of resizing: #232 (comment)

While pjreddie/darknet and ultralytics/yolov3 supports only letter_box.

@yanxurui
Copy link
Author

@AlexeyAB
Got it.
Thank you very much.
I am using the default resize function, which makes it incompatible with the pjreddie/darknet and ultralytics/yolov3.

@AlexeyAB
Copy link
Owner

AlexeyAB commented Jun 23, 2019

@yanxurui Also if you use this repository, then download the latest version.

Only in the last commit was added letter_box=1 to the [net] section.

@AlexeyAB AlexeyAB added the Solved The problem is solved using the correct settings label Jun 23, 2019
@yanxurui
Copy link
Author

Great.

I still don't understand one thing.
If the official weights are trained with the original aspect ratio, how can this repo achieve the same performance (mAP) during valid when it resize the input image to square?

@yanxurui
Copy link
Author

Another question.
The mAPs of detector valid command using this repo with and without -letter_box are the same.
Why is that?
Since the weights are trained without using letter box, I suppose the valid command with -letter_box should be lower.

@AlexeyAB
Copy link
Owner

I still don't understand one thing.
If the official weights are trained with the original aspect ratio, how can this repo achieve the same performance (mAP) during valid when it resize the input image to square?

I don't understand it too :) I got higher mAP on original weights-file (that is trained with letter_box) by using resizing than by using letter_box during detection.
Maybe this is the best practice in some cases - to train with letter_box, and detect with resizing?


The mAPs of detector valid command using this repo with and without -letter_box are the same.
Why is that?

Have you downloaded the latest version of Darknet?

@yanxurui
Copy link
Author

No. I am not using the latest version But I do see this option in my detector.c.
Is -letter_box also added recently?
Thanks.

@AlexeyAB
Copy link
Owner

Is -letter_box also added recently?

For checking mAP - yes.

For detection - several monthes ago.

@yanxurui
Copy link
Author

Great.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Solved The problem is solved using the correct settings
Projects
None yet
Development

No branches or pull requests

2 participants