Is it possible for either Microsoft Computer Vision API or Google's Cloud Vision API to get a location for objects?

こ雲淡風輕ζ 提交于 2020-01-04 02:03:35

问题


I am trying to develop an application that needs to know the location of tagged objects in an image. Knowing that there is a "piano" in an image is not enough, I need to know where that piano is in the image.

Both Microsoft's Computer Vision API and Google's Cloud Vision API provide some form of cropping suggestion/smart thumbnail generation service which leads me to think that the location of certain objects is being detected - however is there a way to get that information (like a bounding box around each detected object) from either Microsoft's Computer Vision API or Google's Cloud Vision API?


EDIT: I understand that both APIs can return the location of faces detected in an image, however I am looking for locations and sizes of every object in an image: cars, pianos, trees, people...anything.


回答1:


Microsoft Vision API offer no pixel coordinates for the detected objects (see return features: https://dev.projectoxford.ai/docs/services/56f91f2d778daf23d8ec6739/operations/56f91f2e778daf14a499e1fa).

However if you want to detect persons Microsoft API can return the coordinates of the face rectangles.




回答2:


I don't know about any API serving you coordinates of the object at this time. What I recommend to use is YOLO which provides you with coordinates of the object. You can use either pre-trained models or train your own.

However, it is not API and you have to code a bit of backend to run in remotely.




回答3:


Hope this could help you https://azure.microsoft.com/en-in/services/cognitive-services/computer-vision/

API:

url:- (In POST) https://{yourvisionapp}.cognitiveservices.azure.com/vision/v2.0/detect
headers:- Content-Type: application/json
Ocp-Apim-Subscription-Key : {yourSubscriptionKey}
body:- {"url":"yoururl"}

sample response:-

{
    "objects": [
        {
            "rectangle": {
                "x": 460,
                "y": 79,
                "w": 141,
                "h": 258
            },
            "object": "window",
            "confidence": 0.508
        },
        {
            "rectangle": {
                "x": 180,
                "y": 240,
                "w": 299,
                "h": 182
            },
            "object": "Billiard table",
            "confidence": 0.635,
            "parent": {
                "object": "table",
                "confidence": 0.676
            }
        },
        {
            "rectangle": {
                "x": 8,
                "y": 11,
                "w": 497,
                "h": 416
            },
            "object": "room",
            "confidence": 0.547
        }
    ],
    "requestId": "f8aafd95-d17d-4088-a34b-ad616f9cde4a",
    "metadata": {
        "width": 640,
        "height": 427,
        "format": "Jpeg"
    }
}


来源:https://stackoverflow.com/questions/41307758/is-it-possible-for-either-microsoft-computer-vision-api-or-googles-cloud-vision

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!