Tag Image Endpoint Enhancements

The PixLab team is pleased to announce major enhancement to the /tagimg endpoint.

The image labeling endpoint let you programmatically generates a description of an image in human readable language with complete sentences. The description is based on the visual content as reported by our state-of-the-art image labeling algorithm. More than one description can be generated for each image. Descriptions are ordered by their confidence score. All descriptions are in English.

the /tagimg endpoint documentation is available to consult here and below a working Python code sample:

import requests
import json

# Tag an image based on detected visual content which mean running a CNN on top of it.

# Target Image
img = 'https://s-media-cache-ak0.pinimg.com/originals/35/d0/f6/35d0f6ee0e40306c41cfd714c625f78e.jpg' 
# Your PixLab key
key = 'My_PixLab_Key'

req = requests.get('https://api.pixlab.io/tagimg',params={'img':img,'key':key})
reply = req.json()
if reply['status'] != 200:
    print (reply['error'])
else:
    total = len(reply['tags']) # Total tags
    print ("Total tags: "+str(total))
    for tag in reply['tags']:
        print("Tag: "+tag['name']+" - Confidence: "+str(tag['confidence']))

You can visit the PixLab Github repository for additional code samples in various programming languages.