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

Nice visualizations! #4

Open
glenn-jocher opened this issue Aug 25, 2020 · 8 comments
Open

Nice visualizations! #4

glenn-jocher opened this issue Aug 25, 2020 · 8 comments

Comments

@glenn-jocher
Copy link

The grid visualizations could be very useful for development and testing, and if fact YOLOv5 uses a new multiple-grid assignment structure that shows up well in your images.

If you have a concise plotting function for creating these perhaps we could do a PR into yolov5/utils/general.py (where all the plotting functions are located).

@seanavery
Copy link
Owner

@glenn-jocher Thanks dude!

Yeah I think it could be useful, I finally was able to understood the model output when I did the grid visualizations.

That sounds great. I still need to clean up the code some more, but will reach out with a PR this week.

@glenn-jocher
Copy link
Author

@seanavery great, sounds good! Introspection is very important to help understand what is going.

@PonyPC
Copy link

PonyPC commented Aug 28, 2020

Best works!

@seanavery
Copy link
Owner

seanavery commented Sep 2, 2020

@glenn-jocher hey, just a little update. getting back to the yolo code

Forked off from your repository and working on implementing a plotting function in general.py called plot_object_probability

One consideration, I am sending the pred output before non_max_suppression is applied in order to maintain the raw output from forward pass.

Example Ops:
1. input (1, 25200, 85)
2. -> [(1, 3, nx0, ny0, 85), (1, 3, nx1, ny1, 85), (1, 3, nx2, ny2, 85)] deconstruct the stacked output
3. -> [(1, nx0, ny0, 1), (1, nx1, nx2, 1), (1, nx2, ny2, 1)] take max object probability of the anchor box sizes per grid cell 
4. -> draw transparent rectangles in a threshold or hue range of the probability score

I was thinking it would be cool if there was a model "debug" mode where visualizations like the object probability, class grid, raw bounding boxes, and anchor statistic could be processed.

Making sure to use matplot lib to write images to inference/output directory where they can easily be displayed in the notebook.

@seanavery
Copy link
Owner

Object probability grid refactored to pytorch and working in the codebase. works on cpu and gpu

plot_object_probability()

cli argument --mdebug to dispatch the visualization

detect.py

I am still working on removing all hardcoding and simplifying the code more.

@glenn-jocher
Copy link
Author

@seanavery oh that's really cool. Can you show some examples?

Yes, a debug mode would be interesting. If we can keep all of the plots seperated in general.py, or perhaps bring all plotting functions into their own plots.py, so the inline impact is minimal (i.e. in the loss function), then I think this could work well.

@seanavery
Copy link
Owner

seanavery commented Sep 4, 2020

object heatmap

20_20_object_prob
40_40_object_prob
80_80_object_prob

@henbucuoshanghai
Copy link

@seanavery only output the heatmap? where is the box of instances?

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

4 participants