Package: nodeflux-cloud
Nodeflux Cloud Client Library for PythonThis repository is a Python client library for Nodeflux Cloud Analytics. It implements the APIs defined innodefluxapis.Installationpip install nodeflux-cloudExample# image_analytic.pyfromnodeflux.cloud.clientsimportImageAnalyticClientfromnodeflux.cloud.requestsimportImageAnalyticRequest,AnalyticTypesclient=ImageAnalyticClient()withopen('some-image.jpg','rb')asimage_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:$exportNODEFLUX_ACCESS_KEY={YOUR_ACCESS_KEY}$exportNODEFLUX_SECRET_KEY={YOUR_SECRET_KEY}$pythonimage_analytic.py
responses{face_detections{bounding_box{top:0.24583333730697632left:0.2984375059604645height:0.6583333015441895width:0.3749999701976776}confidence:0.871170473098755}face_recognitions{candidates{face_id:17136476860973057confidence:9.6}}face_demographics{gender:FEMALEgender_confidence:0.9403232932090759age:19}}More examples can be found in theexampledirectory.ReferenceImageAnalyticClientMethod NameRequest TypeResponse TypeDescriptionbatch_image_analyticList[ImageAnalyticRequest]BatchImageAnalyticResponseRun image analytics for a batch of imagesstream_image_analyticIterator[ImageAnalyticRequest]Iterator[ImageAnalyticResponse]Run image analytics for a stream of imagesImageAnalyticRequestIndividual image request to be analyzed by Nodeflux Cloud.FieldTypeDescriptionimagebytesImage to be analyzed in the Nodeflux Cloud.analyticsList[AnalyticTypes]A list of analytics to be performed to the image.AnalyticTypesEnums of analytic types supported by Nodeflux Cloud.EnumsDescriptionFACE_DETECTIONDetect faces from an image.FACE_DEMOGRAPHYPredict age and gender from faces in the image.FACE_RECOGNITIONSearch for similar faces in the face recognition database.VEHICLE_RECOGNITIONDetect vehicles from an image.LICENSE_PLATE_RECOGNITIONRecognize license plate number of vehicles in an image.BatchImageAnalyticResponseResponse to a batch image analytic request.FieldTypeLabelDescriptionresponsesImageAnalyticResponserepeatedIndividual responses to image analytics requests within the batch.ImageAnalyticResponseResponse to an image analytic request.FieldTypeLabelDescriptionerrorgoogle.rpc.StatusIf set, represents the error message for the operation. Note that filled-in image analytics response are guaranteed to be correct, even whenerroris set.extensionsgoogle.protobuf.AnyrepeatedIf present, extension analytics has completed successfully.face_detectionsnodeflux.analytics.v1beta1.FaceDetectionrepeatedIf present, face detection has completed successfully.face_recognitionsnodeflux.analytics.v1beta1.FaceRecognitionrepeatedIf present, face recognition has completed successfully.face_demographicsnodeflux.analytics.v1beta1.FaceDemographyrepeatedIf present, face demographics has completed successfully.vehicle_detectionsnodeflux.analytics.v1beta1.VehicleDetectionrepeatedIf present, vehicle has completed successfully.license_plate_recognitionsnodeflux.analytics.v1beta1.LicensePlateRecognitionrepeatedIf present, license plate recognition has completed successfully.