I would like to analyse pictures from Instagram with Google Vision. Up to now, I collected posts from Instagram by hashtag. So I have a CSV/XLS where the information per post is "stored". Title, coordinates and the links to the images.
Now I used the following python script to receive the annotations (labels) from pictures (I had to download the pictures first)
import io
import os
from google.cloud import vision
from google.cloud.vision import types
os.environ["GOOGLE_APPLICATION_CREDENTIALS"]="../mycredentials.json"
vision_client=vision.ImageAnnotatorClient()
file_name = "horse.jpg"
with io.open(file_name,'rb') as image_file:
content = image_file.read()
image = types.Image(content=content)
response = vision_client.label_detection(image=image)
labels = response.label_annotations
for label in labels:
print(label.description)
This script allows me to receive the the annotations by an individual, pre-downloaded script (here horse.jpg
)
My question now: any idea of how to send the links for the images of the post-collection (in my CSV/XLS) to google vision? In other words, not to download pictures first and analyse them via API one by one, but just using the Links and than receive the annotations automatically for all picture-links in the CSV?