I am new to python and cloud vision.I need to label ~20k images.My code although does the work, needs lots of time to process.Is there a way I can be more efficient?Any help will be really appreciated
filename=[]
description=[]
score=[]
for root, dirs, filenames in os.walk(indir):
for f in filenames:
if f.endswith('.jpg'):
file_name=indir+'/'+f
with io.open(file_name, 'rb') as image_file:
content = image_file.read()
image = types.Image(content=content)
response = client.label_detection(image=image)
labels = response.label_annotations
for label in labels:
filename.append(f)
description.append(label.description)
score.append(label.score)
import pandas as pd
vision_op = pd.DataFrame(
{'filename': filename,
'description': description,
'score': score
})
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)