Nodeflux Cloud Client Library for Python
This repository is a Python client library for Nodeflux Cloud Analytics. It implements the APIs defined in nodefluxapis.
Installation
pip install nodeflux-cloud
Example
# image_analytic.py
from nodeflux.cloud.clients import ImageAnalyticClient
from nodeflux.cloud.requests import ImageAnalyticRequest, AnalyticTypes
client = ImageAnalyticClient()
with open('some-image.jpg', 'rb') as image_file:
image_content = image_file.read()
requests = [
ImageAnalyticRequest(
image_content,
[
AnalyticTypes.FACE_DETECTION,
AnalyticTypes.FACE_DEMOGRAPHY,
AnalyticTypes.FACE_RECOGNITION,
],
)
]
response = client.batch_image_analytic(requests)
print(response)
Setup your credentials and run the example:
$ export NODEFLUX_ACCESS_KEY={YOUR_ACCESS_KEY}
$ export NODEFLUX_SECRET_KEY={YOUR_SECRET_KEY}
$ python image_analytic.py
responses {
face_detections {
bounding_box {
top: 0.24583333730697632
left: 0.2984375059604645
height: 0.6583333015441895
width: 0.3749999701976776
}
confidence: 0.871170473098755
}
face_recognitions {
candidates {
face_id: 17136476860973057
confidence: 9.6
}
}
face_demographics {
gender: FEMALE
gender_confidence: 0.9403232932090759
age: 19
}
}
More examples can be found in the example directory.
Reference
ImageAnalyticClient
| Method Name | Request Type | Response Type | Description |
|---|---|---|---|
| batch_image_analytic | List[ImageAnalyticRequest] | BatchImageAnalyticResponse | Run image analytics for a batch of images |
| stream_image_analytic | Iterator[ImageAnalyticRequest] | Iterator[ImageAnalyticResponse] | Run image analytics for a stream of images |
ImageAnalyticRequest
Individual image request to be analyzed by Nodeflux Cloud.
| Field | Type | Description |
|---|---|---|
image |
bytes |
Image to be analyzed in the Nodeflux Cloud. |
analytics |
List[AnalyticTypes] |
A list of analytics to be performed to the image. |
AnalyticTypes
Enums of analytic types supported by Nodeflux Cloud.
| Enums | Description |
|---|---|
FACE_DETECTION |
Detect faces from an image. |
FACE_DEMOGRAPHY |
Predict age and gender from faces in the image. |
FACE_RECOGNITION |
Search for similar faces in the face recognition database. |
VEHICLE_RECOGNITION |
Detect vehicles from an image. |
LICENSE_PLATE_RECOGNITION |
Recognize license plate number of vehicles in an image. |
BatchImageAnalyticResponse
Response to a batch image analytic request.
| Field | Type | Label | Description |
|---|---|---|---|
| responses | ImageAnalyticResponse | repeated | Individual responses to image analytics requests within the batch. |
ImageAnalyticResponse
Response to an image analytic request.
| Field | Type | Label | Description |
|---|---|---|---|
| error | google.rpc.Status | If set, represents the error message for the operation. Note that filled-in image analytics response are guaranteed to be correct, even when error is set. |
|
| extensions | google.protobuf.Any | repeated | If present, extension analytics has completed successfully. |
| face_detections | nodeflux.analytics.v1beta1.FaceDetection | repeated | If present, face detection has completed successfully. |
| face_recognitions | nodeflux.analytics.v1beta1.FaceRecognition | repeated | If present, face recognition has completed successfully. |
| face_demographics | nodeflux.analytics.v1beta1.FaceDemography | repeated | If present, face demographics has completed successfully. |
| vehicle_detections | nodeflux.analytics.v1beta1.VehicleDetection | repeated | If present, vehicle has completed successfully. |
| license_plate_recognitions | nodeflux.analytics.v1beta1.LicensePlateRecognition | repeated | If present, license plate recognition has completed successfully. |
Metadata
Release files for nodeflux-cloud 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| nodeflux-cloud-0.2.2.tar.gz | 12.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nodeflux_cloud-0.2.2-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 34.5 kB
Release files / nodeflux-cloud-0.2.2.tar.gz
| Download URL | nodeflux-cloud-0.2.2.tar.gz |
|---|---|
| Size | 12.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3aa30fc8d763323132771c4f57df3efbe2921ba8905be05a35ff19d0b97bdfab
|
|
BLAKE2b-256 checksum How to use checksums |
15c2bc4916d933f5ee8e37ed4c51eb1416abfd269b8c63aa0f850f624ce8a774
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7
|
Release files / nodeflux_cloud-0.2.2-py2.py3-none-any.whl
| Download URL | nodeflux_cloud-0.2.2-py2.py3-none-any.whl |
|---|---|
| Size | 21.6 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
a92db038645b1a70b4c1aaddffcd927757a67da27d9af7271c5ed037a3ba8748
|
|
BLAKE2b-256 checksum How to use checksums |
b2a8cda00e70e9ca11b1121a07503e52ae254b1c0dabdeaf4f41cd2a9a2d7d2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7
|
Security for nodeflux-cloud 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.