question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how to visualize a detection model?

See original GitHub issue

❓ Questions and Help

I was trying to visualize a detection model built in maskrcnn_benchmark, for deeper analytics. I have tried two ways:

  1. export to onnx format model, then use Netron for visualize.
  2. use pytorchviz for visualize.

But they all raise a error like Auto nesting doesn't know how to process an input object of type maskrcnn_benchmark.structures.image_list.ImageList. Accepted types: Tensors, or lists/tuples of them

Obviously, there are two mountains stopped me, ImageList and BoxList, it seems like I should wait until ONNX standard supports these operators.

I am here looking for some help. Is there any solutions or tricks to visualize a model?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
veraposeidoncommented, Mar 1, 2019

@qizhuli It works, thanks a lot! And instead of using FileIO to save a graph infomation, I found a more convenient way to do this. Just use:

graph.format = format
graph.reder(filename)

where:

  • graph is graph representation returned by funtion make_dot.
  • ‘format’ is the file format you want to save. For your infomation, here is a list of formats that graphviz support. https://www.graphviz.org/doc/info/output.html
  • ‘filename’ is the path you want to save.

for example. Instead of:

graph = make_dot(loss, params=dict(list(model.named_parameters()) + [('dummy_image',dummy_image)]))
with open(args.output_path, 'w') as f:
    f.write(str(graph))
f.close()

Use:

graph = make_dot(loss, params=dict(list(model.named_parameters()) + [('dummy_image',dummy_image)]))
graph.format = 'pdf'
graph.render("visPDF")

then, this will generate two files: visPDF and visPDF.pdf. visPDF is text file same as FileIO generated, and visPDF.pdf is the visualized file.

by the way, do find a good format after tries. png format generated blurred image, and jpg report bugs. pdf works fine.

2reactions
qizhulicommented, Feb 28, 2019

Sure! Here is the output of my script for ResNet50-FPN Mask-RCNN network ($root/configs/e2e_mask_rcnn_R_50_FPN_1x.yaml). Simply save it at $file_path and run xdot $file_path to visualise it.

Edit: I rendered it into a pdf file for your viewing convenience 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visualizing Object Detections | Voxel51 - Medium
The best way to increase your understanding of your detection model is to go through and visualize its outputs directly on images. FiftyOne ......
Read more >
Visualizing Object Detection Features
Abstract We introduce algorithms to visualize feature spaces used by object detectors. Our method works by inverting a visual feature back to multiple...
Read more >
Visualizing Machine Learning Models: Guide and Tools
For example, Deep View visualizes models using its own metrics for monitoring such as discriminability and density metrics, which help detect overfitting by ......
Read more >
Visualize your Object Detection Models with Jacques Verré
If an image is worth a thousand words, what's the value of a customizable dashboard? Computer vision models are difficult to debug because ......
Read more >
How to Detect, Handle and Visualize Outliers
When I first started developing data science projects, I didn't care about data visualization nor outlier detection, I only cared about creating cool...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found