0

in google vision api label detection, can't know where object located ? any options or idea ?? I have tried in sample, and then response json is does not include object position!

pm0733464
  • 2,862
  • 14
  • 16
Yeon JunHo
  • 11
  • 2
  • Possible duplicate of [How to get a position of custom object on image using vision recognition api](http://stackoverflow.com/questions/38634409/how-to-get-a-position-of-custom-object-on-image-using-vision-recognition-api) – Nakilon Apr 16 '17 at 15:55

1 Answers1

-1
try this
import io
from google.cloud import vision
import argparse
import base64
import picamera
import json
import os
import picamera
import sys

from googleapiclient import discovery
from oauth2client.client import GoogleCredentials

    os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "provide here the json key path"
    camera = picamera.PiCamera()


    camera.capture('pic1.jpg')
    credentials = GoogleCredentials.get_application_default()
    service = discovery.build('vision', 'v1', credentials=credentials)

    vision_client=vision.Client()
    file_name='pic1.jpg'

    with io.open(file_name,'rb') as image_file:
        content=image_file.read()
        image=vision_client.image(content=content)


    labels = image.detect_labels()

    for label in labels:
        print(label.description)

`
  • You should explain your code only answer. Code only answers are often downvoted and may even be deleted. Thank you. – Bugs Jul 01 '17 at 21:03