用于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:字符串。RTL设备语言用标志“+”格式化,数字后加符号   java GAE作为桌面应用程序(Swing)的服务提供商   java将InputStream转换为FileInputStream不适用于Apache POI   java外部Voronoi库“网格”:什么是草图和处理?   重载重写的泛型方法java   java显示组织上设置的错误。springframework。验证。jsp中的错误对象   java一些Spring模型属性没有显示在我的JSP中   java无法编译Guava 23的SimpleTimeLimiter示例   java如何更改JTree中的“根”目录名?   java如何在安卓中对相对布局产生连锁反应?   java错误:org。冬眠例外SQLGrammarException:无法提取结果集,dateAccessed是未知列   如何使用java监听JSON文件更新   由抽象封闭类创建的匿名内部类能否通过反射确定实现类?