用于python的nodeflux云客户端库。

nodeflux-cloud的Python项目详细描述


用于python的nodeflux云客户端库

此存储库是用于Nodeflux云分析的Python客户端库它实现了nodefluxapis中定义的api。

安装

pip install nodeflux-cloud

示例

# 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)

设置凭据并运行示例:

$ exportNODEFLUX_ACCESS_KEY={YOUR_ACCESS_KEY}
$ exportNODEFLUX_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}}

更多示例可以在example目录中找到。

参考

图像分析客户端

Method NameRequest TypeResponse TypeDescription
batch_image_analyticList[ImageAnalyticRequest]BatchImageAnalyticResponseRun image analytics for a batch of images
stream_image_analyticIterator[ImageAnalyticRequest]Iterator[ImageAnalyticResponse]Run image analytics for a stream of images

图像分析请求

单个图像请求由Nodeflux云进行分析

FieldTypeDescription
^{}^{}Image to be analyzed in the Nodeflux Cloud.
^{}^{}A list of analytics to be performed to the image.

分析类型

nodeflux云支持的分析类型枚举。

EnumsDescription
^{}Detect faces from an image.
^{}Predict age and gender from faces in the image.
^{}Search for similar faces in the face recognition database.
^{}Detect vehicles from an image.
^{}Recognize license plate number of vehicles in an image.

BatchImageAnalyticResponse

对批处理图像分析请求的响应。

FieldTypeLabelDescription
responsesImageAnalyticResponserepeatedIndividual responses to image analytics requests within the batch.

图像分析响应

对图像分析请求的响应。

FieldTypeLabelDescription
errorgoogle.rpc.StatusIf set, represents the error message for the operation. Note that filled-in image analytics response are guaranteed to be correct, even when ^{} is 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.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Android Action_Edit Intent无法像以前一样调用App Gallery来编辑图片   确保JRE兼容性的java适当程序(32或64位)   java JSONArray。for循环中的add(JSONObject)正在替换for循环中的旧值,数组由循环中的最后一个值组成   java需要帮助创建一个返回数组的方法,该数组的元素是另一个数组的平方   使用SmbFile w/groovy XmlSluper()创建xml。解析()Java   检查大小后的java ArrayIndexOutOfBoundsException   乘法表中的第k个最小元素   java 401 on请求,其中指定了'permitAll()'   java如何附加ORC文件   java hibernate类模型   java IDEA没有看到由自定义注释处理器生成的方法   Servlet中未声明java SerialVersionId   java linkedlist到达列表末尾时   java如何正确对齐EditText光标?   java 6编译器1.6上的eclipse重写方法错误   java如何在基于Jersey的RESTful Web服务中读取post数据   java如何在活动中正确使用接口?   Java的JIT编译器的工作速度有多快?