Reputation: 33
I am trying to scrape images from websites and use Google Cloud Vision API to detect if an image on the website is a logo. It works if I provide it a logo like Apple, but it doesn't seem to work for well known non fortune-500 tech company logos (e.g., LaunchDarkly, LogDNA, etc) despite the images clearly being logos. Is it supposed to work for any type of logo or only large brands? Is there a solution out there better suited for my needs?
client = vision.ImageAnnotatorClient()
with io.open('./img.png', 'rb') as image_file:
content = image_file.read()
image = vision.types.Image(content=content)
response = client.logo_detection(image=image)
logos = response.logo_annotations
for logo in logos:
print(logo.description)
print(logo.score)
if response.error.message:
raise Exception(
'{}\nFor more info on error messages, check: '
'https://cloud.google.com/apis/design/errors'.format(
response.error.message))
Upvotes: 0
Views: 1861
Reputation: 468
As explained in the documentation, Logo Detection detects popular product logos. It is expected that it doesn't detect logos with which the model has not been trained.
The solution you can try within CGP is AutoML Vision. This product allows you to retrain GCP's models to classify your images according to your own defined labels. You can create a dataset with the logos you need to detect and retrain the models with it. It has a very easy interface to be able to do it even if you don't have any Machine Learning expertise.
Upvotes: 1