A PyPI package to extract insightful information about an image using Machine Intelligence
Project description
Cornea
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cornea-1.1.0.tar.gz
(2.7 kB
view details)
File details
Details for the file cornea-1.1.0.tar.gz
.
File metadata
- Download URL: cornea-1.1.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1611fd034e478bf363382086b83d805c473c87efb6e6d6bca024602f4ac8529 |
|
MD5 | 3889ff08b6c1154a2bf2e367ef9cb673 |
|
BLAKE2b-256 | dd6e04b3e979a2eb854f871af4ed587e4ae45928137332d828e93650ae57d592 |