Maskrcnn-benchmark: How to get data output from inference?

Created on 27 Feb 2019  路  2Comments  路  Source: facebookresearch/maskrcnn-benchmark

Hey there,

Instead of getting an image that is overlyed with predictions, can we get a JSON with coordinates of the enclosing box and the type of object detected?

That seems like a very basic expectation for automated monitoring of premises and other applications.

Any hints and tips you may have will be appreciated.

question

Most helpful comment

The model output is actually an object of the type BoxList. You can get the result information by doing something like :

output = model(image)
# Bounding boxes
boxes = output.bbox 
# Labels
labels = output.get_field("labels")
# Scores
scores = output.get_field("scores") 

You can then customize your JSON as you wish.

All 2 comments

The model output is actually an object of the type BoxList. You can get the result information by doing something like :

output = model(image)
# Bounding boxes
boxes = output.bbox 
# Labels
labels = output.get_field("labels")
# Scores
scores = output.get_field("scores") 

You can then customize your JSON as you wish.

Thanks for the explanation @LeviViana !

Was this page helpful?
0 / 5 - 0 ratings