Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

A PyPI package to extract insightful information about an image using Machine Intelligence

Project description

Cornea

PyPI - License Codacy Badge PyPI

A PyPI package to extract insightful information about an image using Machine Intelligence

Requirements

  • Python >=3.7

Installation

The recommended method to install this package is by using pip or pip3

pip3 install cornea
or
python3 -m pip install cornea

Setup

The package requires that you specify your Microsoft Azure API credentials as environment variables. Type the following commands in your terminal. ALternatively, you can also add the following lines at the end of .bashrc or .bash_profile.

export AZURE_API_KEY={{{YOUR_API_KEY}}}
export AZURE_API_BASE_ENDPOINT={{{YOUR_API_REGION_BASE_URL}}}
export AZURE_API_VERSION={{{AZURE_API_VERSION}}}

Example:

export AZURE_API_KEY=QmQZdzdQXftzrOOvCUC7tjx8wzZed8Wk
export AZURE_API_BASE_ENDPOINT=https://eastus.api.cognitive.microsoft.com
export AZURE_API_VERSION=v2.0

Usage

from cornea import descImgFromURL

analysis = descImgFromURL("https://upload.wikimedia.org/wikipedia/commons/b/b9/CyprusShorthair.jpg")
print(analysis)

Output

{'categories': [{'name': 'animal_cat', 'score': 0.99609375}], 'color': {'dominantColorForeground': 'Grey', 'dominantColorBackground': 'Grey', 'dominantColors': ['Grey'], 'accentColor': '5C4E3C', 'isBwImg': False, 'isBWImg': False}, 'description': {'tags': ['cat', 'indoor', 'laying', 'bed', 'sitting', 'white', 'brown', 'lying', 'small', 'large', 'sleeping'], 'captions': [{'text': 'a cat lying on a bed', 'confidence': 0.9512938154506553}]}, 'requestId': 'ef807a48-ecbf-4c30-883b-64a7d25683f2', 'metadata': {'width': 1024, 'height': 768, 'format': 'Jpeg'}}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for cornea, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size cornea-1.1.0.tar.gz (2.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page