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

in detection box[2] < box[0] #97

Open
ssusie opened this issue Jan 13, 2020 · 3 comments
Open

in detection box[2] < box[0] #97

ssusie opened this issue Jan 13, 2020 · 3 comments

Comments

@ssusie
Copy link

ssusie commented Jan 13, 2020

Hi,

my training failed on epoch 13 when computing mAP the validation set. The detected boxes on an image have box[2] < box[0]. The detection looks like

[6.53528833e+00, 1.19281548e+02, 8.85683000e-01, 8.01131470e+02, 1.10095531e-01]

Any idea why this is happening and how I can fix it?

@hgaiser
Copy link
Contributor

hgaiser commented Jan 16, 2020

There are 5 values in that detection, what do they represent? Usually it is 4 values for the bbox, 1 value for the label and 1 value for the score.

@ssusie
Copy link
Author

ssusie commented Jan 16, 2020

Thanks for the response!

I should have been more clear about that. The values I printed are from

all_detections, all_masks = _get_detections(generator, model, score_threshold=score_threshold,
                                                max_detections=max_detections, save_path=save_path)
detections = all_detections[i][label]

The first four coordinates represent a box, and the last one is the score of the box.

I also happen to have detection

[0.00000000e+00 7.02915344e+01 2.16546636e-02 8.10687439e+02
7.03362226e-02]

After converting this to int we get [0 70 0 810], which is not actually a box so the code fails on the line
mask = cv2.resize(mask, (box[2] - box[0], box[3] - box[1]))

@hgaiser
Copy link
Contributor

hgaiser commented Jan 20, 2020

Hmm strange, I've never seen this issue before. Are you training for just a few steps and then evaluating? Regardless, this shouldn't be an issue. If you want you can make a fix for the evaluation to ignore these boxes.

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