python-docs-samples icon indicating copy to clipboard operation
python-docs-samples copied to clipboard

AutoML Vision Object Detection Python Code does not return bounding boxes

Open sheldonmccrackin opened this issue 7 years ago • 7 comments

Prediction_client.predict() in the file https://github.com/GoogleCloudPlatform/python-docs-samples/blob/automl_object_detection_april_2019/vision/automl/automl_vision_od_predict.py does not return bounding boxes associated with predicition. Is there a flag I am missing to return bounding boxes? I used this code as is and it returns the correct labels, but no bounding boxes.

sheldonmccrackin avatar Apr 26 '19 21:04 sheldonmccrackin

Hi, it looks like that sample is currently a "Work In Progress" on a separate branch. https://github.com/GoogleCloudPlatform/python-docs-samples/pull/2093

The samples on the master branch are finalized and should be in working order.

You can find more info about AutoML Vision Object Detection on the docs pages: https://cloud.google.com/vision/automl/object-detection/docs/

This page has the reference documentation for AutoML: https://cloud.google.com/vision/automl/object-detection/docs/reference/rpc/google.cloud.automl.v1beta1

Gonna close this for now, since that sample isn't finalized, but feel free to reopen if the links above aren't helpful. :)

nnegrey avatar Apr 29 '19 17:04 nnegrey

@nnegrey the python code for prediction on the docs page https://cloud.google.com/vision/automl/object-detection/docs/predict has the same issue, bounding boxes are not returned. If this is due to the sample not being complete, I completely understand(the product is in Beta). But there are no disclaimers or reference to this in the documentation.

Should we reopen this?

sheldonmccrackin avatar Apr 30 '19 17:04 sheldonmccrackin

The AnnotationPayload returned from the predict method is empty or what kind of results do you see?

nnegrey avatar Apr 30 '19 20:04 nnegrey

@nnegrey The python predict method returns annotation_spec_id and display_name only. The curl method returns the annotation_spec_id, bounding_boxes, display_name and score. Outputs below.

Python output: payload { annotation_spec_id: "1234" display_name: "xxxx" } payload { annotation_spec_id: "1234" display_name: "xxxx" }

Curl Output: { "payload": [ { "annotationSpecId": "1234", "imageObjectDetection": { "boundingBox": { "normalizedVertices": [ { "x": 0.52349, "y": 0.543531 }, { "x": 0.600989, "y": 0.653782 } ] }, "score": 0.996273 }, "displayName": "xxxx" }, { "annotationSpecId": "1234", "imageObjectDetection": { "boundingBox": { "normalizedVertices": [ { "x": 0.599543, "y": 0.543585 }, { "x": 0.667022, "y": 0.644507 } ] }, "score": 0.995843 }, "displayName": "xxxx" } ] }

sheldonmccrackin avatar Apr 30 '19 21:04 sheldonmccrackin

@sirtorry, do you have any ideas on this? Otherwise, I'll try to recreate it.

nnegrey avatar May 13 '19 16:05 nnegrey

branch isn't merged. samples need to be regenerated.

sirtorry avatar May 14 '19 20:05 sirtorry

I've stepped through the entire cloud python automl vision od tutorial. Everything works. I did find issues of friction and entered corresponding bugs. I am closing this issue since the tutorial does return bounding boxes.

andrewferlitsch avatar Jun 12 '19 15:06 andrewferlitsch