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

How to convert model output to coordinates? #8149

Closed
1 task done
sazzadhrz opened this issue Jun 8, 2022 · 5 comments
Closed
1 task done

How to convert model output to coordinates? #8149

sazzadhrz opened this issue Jun 8, 2022 · 5 comments
Labels
question Further information is requested Stale

Comments

@sazzadhrz
Copy link

Search before asking

Question

I always get shape (300, 6) as the output from the "non_max_suppression" function, no matter what image I'm inferencing on. What does this 300 mean? Could you please share how to interpret it to coordinates?

Additional

Found another comment similar to my issue but didn't get any solution from there.
#708 (comment)

@sazzadhrz sazzadhrz added the question Further information is requested label Jun 8, 2022
@chen2mg
Copy link

chen2mg commented Jun 8, 2022

I think the [300, 6] are 300 rows with size of 6 [x1, x2, y1, y2, score, label].

You can set a score threshold and filter this 300 rows, or you can choose top n out of the 300 by sorting the scores.

hope it helps.

@sazzadhrz
Copy link
Author

@chen2mg The lowest score I got is 0.99998. I'm afraid which one to drop!

image
image

@sazzadhrz sazzadhrz reopened this Jun 8, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jul 9, 2022

👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv5 🚀 resources:

Access additional Ultralytics ⚡ resources:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐!

@ArgoHA
Copy link

ArgoHA commented Jul 29, 2022

So is it center_x, center_y, w, h, class, conf?
My problem is that I get 25200 strings with 6 values and last two are always 0 and 1
So or I get all 0 confidence level of I get all 1.0 confidence level. Both are very strange

here is part:

6.50,4.82,13.65,11.75,0.00,1.00
12.60,5.41,24.63,11.55,0.00,1.00
18.36,5.34,32.44,11.44,0.00,1.00
27.29,5.60,31.49,11.88,0.00,1.00
35.28,5.61,30.15,11.71,0.00,1.00
42.86,5.25,28.45,11.11,0.00,1.00
50.98,5.06,28.47,10.46,0.00,1.00
59.14,5.07,28.33,10.43,0.00,1.00
67.28,5.25,28.70,10.40,0.00,1.00
75.39,5.38,28.85,10.54,0.00,1.00
83.36,5.41,29.00,10.64,0.00,1.00
91.45,5.49,29.22,10.71,0.00,1.00
99.47,5.56,29.49,10.75,0.00,1.00
107.49,5.58,29.74,10.75,0.00,1.00
115.47,5.58,29.83,10.82,0.00,1.00
123.49,5.58,29.96,10.80,0.00,1.00
131.53,5.57,29.97,10.84,0.00,1.00
139.56,5.62,29.83,10.87,0.00,1.00
147.56,5.66,29.86,10.97,0.00,1.00
155.68,5.79,30.13,11.12,0.00,1.00
163.68,5.85,30.22,11.22,0.00,1.00
171.63,5.95,30.39,11.35,0.00,1.00
179.63,5.99,30.43,11.47,0.00,1.00
187.66,6.04,30.42,11.53,0.00,1.00
195.66,6.05,30.37,11.61,0.00,1.00
203.63,6.08,30.33,11.65,0.00,1.00
211.64,6.11,30.30,11.71,0.00,1.00
219.69,6.20,30.31,11.83,0.00,1.00
227.62,6.28,30.35,11.99,0.00,1.00
235.57,6.36,30.39,12.10,0.00,1.00
243.58,6.41,30.48,12.18,0.00,1.00
251.63,6.45,30.50,12.23,0.00,1.00
259.62,6.47,30.50,12.30,0.00,1.00
267.57,6.49,30.61,12.32,0.00,1.00
275.55,6.50,30.67,12.35,0.00,1.00
283.55,6.51,30.67,12.34,0.00,1.00
291.53,6.49,30.66,12.39,0.00,1.00

And here is what I've done:

  1. trained yolov5s on custom dataset
  2. used pt weights and export.py on Jetson nano, created .engine
  3. used triton server to deploy that model with output [1, 25200, 6] - batch is 1 and I have 1 class
  4. now I am trying to create a client, I send frames from video with interested object and I am stuck with postprocessing - I get all 0 confs or all 1.0 confs...

@glenn-jocher
Copy link
Member

@ArgoHA based on the provided snippet, it looks like you have the correct interpretation of the output format as [center_x, center_y, width, height, class, confidence]. The vast number of strings with high confidence being either 0 or 1 could indicate an issue with your inference pipeline or postprocessing.

Please check the following:

  1. Ensure that your model has been properly trained and the bounding boxes are being properly annotated in your custom dataset.
  2. Verify that the output tensor format matches the expected output format.
  3. Double-check the yolo layer confidence activation in the export.py file, in case of quantization issues or other discrepancies related to export.py.

Feel free to share more details about your training and inference process or consider consulting the YOLOv5 documentation at https://docs.ultralytics.com/yolov5/ for additional in-depth help.

Best of luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested Stale
Projects
None yet
Development

No branches or pull requests

4 participants