MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.21k stars 21.37k forks source link

ErrorInvalidRegion when uploading images to CustomVision.ai #96584

Closed shubhamjante closed 2 years ago

shubhamjante commented 2 years ago

Hi, I'm trying to build ObjectDetector model using customvision.ai. As we know web UI does not provide any option to zoom in or out functionality. I'm dealing with large-sized images and need to zoom in to annotate the objects properly. So instead of web UI now I'm using LabelImg tool to annotate the images and Azure python SDK to tag and upload images on customvision.ai.

I'm aware that the custom vision needs coordinates in normalized format and LabelImg provides those coordinates I believe. If you go through the below dict you will notice few images have a single object and a few might have multiple objects. I'm interpreting below coordinates as x, y, w, h. {'1-A223': [ [0.088942, 0.126316, 0.168269, 0.168421], [0.592147, 0.131579, 0.254808, 0.178947], [0.774038, 0.136842, 0.073718, 0.168421], [0.865385, 0.131579, 0.073718, 0.178947], [0.956731, 0.136842, 0.073718, 0.189474], [0.228365, 0.489474, 0.075321, 0.852632], [0.31891, 0.468421, 0.076923, 0.852632], [0.409455, 0.263158, 0.075321, 0.442105] ], '1-A312': [ [0.495033, 0.47191, 0.963576, 0.876404] ], '2-A223A': [ [0.091346, 0.457143, 0.173077, 0.857143], [0.295673, 0.457143, 0.171474, 0.8], [0.498397, 0.442857, 0.173077, 0.771429], [0.701923, 0.471429, 0.169872, 0.771429], [0.907853, 0.5, 0.171474, 0.828571] ], '2-A223B': [ [0.233974, 0.465909, 0.464744, 0.840909], [0.746795, 0.488636, 0.490385, 0.886364] ] }

Sample Code Screenshot

For the above coordinates, it's showing ErrorInvalidRegion. I'm not sure if is it because of the SDK issue or if something is wrong with the coordinates. I used the above coordinates to draw a rectangle on it I multiplied w with the actual width of the image and h with the actual height of the image.

Sample Code to draw a rectangle on image


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

YutongTie-MSFT commented 2 years ago

Thanks for the feedback! We are currently investigating and will update you shortly.

YutongTie-MSFT commented 2 years ago

Hello @shubhamjante, I am sorry this issue seems out of scope for this forum, I will highly suggest you to raise a support ticket for this issue or post it to Microsoft Q&A platform.

Please let me know if you have no support plan and I am willing to enable you one, forwarded this issue to product team for checking if this is a SDK issue as well.

We will now proceed to close this thread. If there are further questions regarding this matter, please respond here and @YutongTie-MSFT and we will gladly continue the discussion.