-1

Code :

from google.cloud import vision
import google.cloud.proto.vision.v1.image_annotator_pb2 as pvv 
import io

client = vision.ImageAnnotatorClient()

def mkrl(imageStr):
    im_obj = pvv.Image(content = imageStr)
    return pvv.AnnotateImageRequest(image = im_obj, features = [{"type": "TEXT_DETECTION"}])

def getR(imageList):
    req = map(mkrl,imageList)
    response = client.batch_annotate_images(req)
    return response

I'm trying to extract text from an image using the google vision api. I need to send a batch of images - things were working fine but now there is this error:

ImportError: No module named 'google.cloud.proto.vision'

Jonathan Porter
  • 1,365
  • 7
  • 34
  • 62
aryan singh
  • 151
  • 11

1 Answers1

0

this has been solved.....

the correct way to import this is :

import google.cloud.vision_v1.proto.image_annotator_pb2 as pvv

or

from google.cloud.vision_v1.proto import image_annotator_pb2 as pvv

aryan singh
  • 151
  • 11