Skip to main content

Nodeflux Cloud Client Library for Python

Installation

pip install nodeflux-cloud

Usage

Set the environment variable NODEFLUX_ACCESS_KEY and NODEFLUX_SECRET_KEY to your keys.

from nodeflux.cloud.clients import ImageAnalyticClient
from nodeflux.cloud.requests import ImageAnalyticRequest, AnalyticTypes

client = cloud.ImageAnalyticClient()

with open("some-image.jpg", "rb") as image_file:
    image_content = image_file.read()

requests = [
    ImageAnalyticRequest(
        image=image_content,
        analytics=[
            AnalyticTypes.FACE_DETECTION,
            AnalyticTypes.FACE_DEMOGRAPHY,
        ]
    )
]

response = client.batch_image_analytic(requests)
print(response)

API Reference

class ImageAnalyticClient(transport=None)

Service that performs Nodeflux Cloud image analytics.

Parameters Type Description
transport ImageAnalyticGrpcTransport Transport for the API call. The default transport uses gRPC protocol.

batch_image_analytic

Run analytics to a batch of images.

Parameters Type Description
requests List[ImageAnalyticRequest] A batch of Nodeflux Cloud image analytic request.

class ImageAnalyticRequest(image: bytes, analytics: List[AnalyticTypes])

Individual image request to be analyzed by Nodeflux Cloud.

Parameters 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.

class 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.

class BatchmageAnalyticResponse

Response from Nodeflux Cloud image analytic request.

face_detections: List[FaceDetection]

If present, face detection analytic has completed successfully.

face_demographics: List[FaceDemography]

If present, face demography analytic has completed successfully.

face_recognitions: List[FaceRecognition]

If present, face recognition analytics has completed successfully.

vehicle_detections: List[VehicleDetection]

If present, vehicle detection analytics has completed successfully.

license_plate_recognitions: List[LicensePlateRecognition]

If present, license plate recognition analytics has completed successfully.

class FaceDetection

bounding_box: BoundingBox

Bounding box around the detected face.

confidence: float

Confidence of the face detection.

class FaceDemography

gender: Gender

Detected gender from a face.

gender_confidence: float

Confidence of gender detection

age_range: AgeRange

The estimated age range.

class FaceRecognition

candidates: List[FaceCandidate]

List of candidates that matches the requested face. If candidates is set, the face recognition analytic has been successful.

class FaceCandidate

id: int64

Unique id of the recognized face.

confidence: float

Confidence of the recognition.

Release files for nodeflux-cloud 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nodeflux-cloud 0.1.2
File Size Uploaded
nodeflux-cloud-0.1.2.tar.gz 27.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nodeflux-cloud 0.1.2
File Interpreter ABI Platform
nodeflux_cloud-0.1.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 83.6 kB

Release files / nodeflux-cloud-0.1.2.tar.gz

Download URL nodeflux-cloud-0.1.2.tar.gz
Size 27.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4be43fc734675def83aec0d207dfdb49df1651d68f61975e2a8808c8fca0cceb
BLAKE2b-256 checksum
How to use checksums
15666f4d7aabb3ec934664d2ac7702dcd4b214563e7f4a7f1df8d9e561ffda21
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.1.2-py2.py3-none-any.whl

Download URL nodeflux_cloud-0.1.2-py2.py3-none-any.whl
Size 55.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e7e63cca5d7d127cd7038ab1365f5ceafa29fddb20f3d1e547753d7958f3d5cf
BLAKE2b-256 checksum
How to use checksums
2e3a9ffefc3b5501a10d1559bc2c21d5c33e9e9a7badf3f6fe0fa0ba3e557ade
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 history Release notifications | RSS feed

0.2.2

2 release files

This release

0.1.2 This release

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page