Run a corpus of images through multiple computer vision API vendors. View image labeing results side by side so that you can get a general feel for how well each vendor works for your use case. Supported vendors: Microsoft, IBM, Google, Cloudsight, and Clarifai.
Read this blog post for details.
- For a given directory of images, and list of vendors:
- Call each vendor API for that image (or skip it if cached), e.g. call Google for dog_at_the_park.jpg.
- Store results in a JSON file with the name: filename.vendor.json, e.g. dog_at_the_park.jpg.google.json.
- Create a scaled copy of the original image with height 200px.
- Generate output.html to show all the images and labeling results in an easy to consume manner.
- Get keys for each vendor, and put them in a file called api_keys.json (copy example_api_keys.json to get started).
- Install dependencies (see below).
- Place all your images in
./input_images
. - Run the script:
python cloudy_vision.py
- View
./output/output.html
to see results. - If you add more images, simply re-run the script. Prior results are cached.
Install these dependencies:
pip install cloudsight
pip install git+git://github.com/Clarifai/clarifai-python.git
pip install --upgrade watson-developer-cloud
pip install Jinja2
And OpenCV... which can be a pain. OpenCV is only used to resize the images for display. If you don't care about this, you can remove the dependencie, and remove the call to resize and copy images (or email me for help).
If you make modifications that may help others, please fork and send me a pull request. Some ideas for contributions: (a) add new image recognition vendors, (b) expose more attributes per vendor, e.g. face detection, (c) bugs, requests, feedback.
Authored by @goberoi
MIT License - Copyright (c) 2016 Gaurav Oberoi.