Unofficial DeepAI python module
Project description
pydeepai
Unofficial DeepAI python module
Examples
Create a API object
Without proixes:
>>> from PyDeepAI import API
>>> DEEPAI_API = API(key='quickstart-QUdJIGlzIGNvbWluZy4uLi4K')
>>> print(str(DEEPAI_API))
<API quickstart-QUdJIGlzIGNvbWluZy4uLi4K>
With proixes:
>>> from PyDeepAI import API
>>> DEEPAI_API = API(key='quickstart-QUdJIGlzIGNvbWluZy4uLi4K', proxies={
"http": "http://localhost:1000",
"https": "http://localhost:1000"
>>> })
>>> print(str(DEEPAI_API))
<API quickstart-QUdJIGlzIGNvbWluZy4uLi4K>
Make a Request
>>> IMAGE_URL = 'https://otnoshenija.ru/wp-content/uploads/2019/11/sinonimy-otnosheniya-druzheskie.jpg'
>>> print(DEEPAI_API.request('facial-recognition', IMAGE_URL))
{'id': 'b727c61b-c55e-4b4b-af61-f075afd08e38', 'output': {'faces': [{'confidence': '0.99', 'bounding_box': [8, 617, 202, 242], 'name': 'face'}, {'confidence': '0.93', 'bounding_box': [285, 347, 129, 161], 'name': 'face'}, {'confidence': '0.97', 'bounding_box': [566, 114, 158, 191], 'name': 'face'}, {'confidence': '0.9', 'bounding_box': [450, 294, 152, 191], 'name': 'face'}, {'confidence': '0.87', 'bounding_box': [675, 399, 135, 188], 'name': 'face'}, {'confidence': '0.65', 'bounding_box': [799, 377, 154, 176], 'name': 'face'}, {'confidence': '0.91', 'bounding_box': [559, 649, 158, 184], 'name': 'face'}, {'confidence': '0.93', 'bounding_box': [1005, 319, 182, 219], 'name': 'face'}, {'confidence': '0.81', 'bounding_box': [879, 611, 231, 242], 'name': 'face'}]}}
>>> import requests
>>> IMAGE = requests.get(IMAGE_URL).content
>>> print(DEEPAI_API.request('facial-recognition', IMAGE, 'image'))
{'id': 'b727c61b-c55e-4b4b-af61-f075afd08e38', 'output': {'faces': [{'confidence': '0.99', 'bounding_box': [8, 617, 202, 242], 'name': 'face'}, {'confidence': '0.93', 'bounding_box': [285, 347, 129, 161], 'name': 'face'}, {'confidence': '0.97', 'bounding_box': [566, 114, 158, 191], 'name': 'face'}, {'confidence': '0.9', 'bounding_box': [450, 294, 152, 191], 'name': 'face'}, {'confidence': '0.87', 'bounding_box': [675, 399, 135, 188], 'name': 'face'}, {'confidence': '0.65', 'bounding_box': [799, 377, 154, 176], 'name': 'face'}, {'confidence': '0.91', 'bounding_box': [559, 649, 158, 184], 'name': 'face'}, {'confidence': '0.93', 'bounding_box': [1005, 319, 182, 219], 'name': 'face'}, {'confidence': '0.81', 'bounding_box': [879, 611, 231, 242], 'name': 'face'}]}}
>>> import requests
>>> IMAGE = requests.get(IMAGE_URL).content
>>> open("file.jpg", "wb").write(IMAGE)
>>> print(DEEPAI_API.request('facial-recognition', open('file.jpg', 'rb'), 'image'))
{'id': 'b727c61b-c55e-4b4b-af61-f075afd08e38', 'output': {'faces': [{'confidence': '0.99', 'bounding_box': [8, 617, 202, 242], 'name': 'face'}, {'confidence': '0.93', 'bounding_box': [285, 347, 129, 161], 'name': 'face'}, {'confidence': '0.97', 'bounding_box': [566, 114, 158, 191], 'name': 'face'}, {'confidence': '0.9', 'bounding_box': [450, 294, 152, 191], 'name': 'face'}, {'confidence': '0.87', 'bounding_box': [675, 399, 135, 188], 'name': 'face'}, {'confidence': '0.65', 'bounding_box': [799, 377, 154, 176], 'name': 'face'}, {'confidence': '0.91', 'bounding_box': [559, 649, 158, 184], 'name': 'face'}, {'confidence': '0.93', 'bounding_box': [1005, 319, 182, 219], 'name': 'face'}, {'confidence': '0.81', 'bounding_box': [879, 611, 231, 242], 'name': 'face'}]}}
>>> import requests, io
>>> IMAGE = io.BytesIO(requests.get(IMAGE_URL).content)
>>> print(DEEPAI_API.request('facial-recognition', IMAGE, 'image'))
{'id': 'b727c61b-c55e-4b4b-af61-f075afd08e38', 'output': {'faces': [{'confidence': '0.99', 'bounding_box': [8, 617, 202, 242], 'name': 'face'}, {'confidence': '0.93', 'bounding_box': [285, 347, 129, 161], 'name': 'face'}, {'confidence': '0.97', 'bounding_box': [566, 114, 158, 191], 'name': 'face'}, {'confidence': '0.9', 'bounding_box': [450, 294, 152, 191], 'name': 'face'}, {'confidence': '0.87', 'bounding_box': [675, 399, 135, 188], 'name': 'face'}, {'confidence': '0.65', 'bounding_box': [799, 377, 154, 176], 'name': 'face'}, {'confidence': '0.91', 'bounding_box': [559, 649, 158, 184], 'name': 'face'}, {'confidence': '0.93', 'bounding_box': [1005, 319, 182, 219], 'name': 'face'}, {'confidence': '0.81', 'bounding_box': [879, 611, 231, 242], 'name': 'face'}]}}
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
PyDeepAI-0.2.0.tar.gz
(2.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file PyDeepAI-0.2.0.tar.gz.
File metadata
- Download URL: PyDeepAI-0.2.0.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6181a60f6449fae63406bb93e5429faab932eee5b5a408ba882192b8e5ed3bf
|
|
| MD5 |
f7e035bb20363331d1f0f918e1e5afae
|
|
| BLAKE2b-256 |
f6761f12a350fb40b2835cf364b9f6ec931d5669977e08baac28a73b1c74320e
|
File details
Details for the file PyDeepAI-0.2.0-py3-none-any.whl.
File metadata
- Download URL: PyDeepAI-0.2.0-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7601f239889cc7c56124f9541457f2743e0866fd6b3b08e1985d9d11365c1b8f
|
|
| MD5 |
3f6fe4a4953920977b9b604b25a820ce
|
|
| BLAKE2b-256 |
784ed0476862167deb63ea95e39440c261069df662995bd61df08552c48cd7db
|