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.
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 !
Most helpful comment
The model output is actually an object of the type
BoxList. You can get the result information by doing something like :You can then customize your JSON as you wish.