项目作者: kbhattmsft

项目描述 :
Microsoft Cognitive Services API with Spring Boot
高级语言: Shell
项目地址: git://github.com/kbhattmsft/cognitive.git
创建时间: 2017-07-14T13:49:09Z
项目社区:https://github.com/kbhattmsft/cognitive

开源协议:

下载


Microsoft Cognitive Services API with Spring Boot

Consume Microsoft Cognitive Services API from Spring Boot application

Face API Demo

  • Face API [1] example with age and emotion attributes:
    • Git clone
    • FaceAPIDemo/mvn clean install
    • java -jar target/FaceAPIDemo-0.0.1-SNAPSHOT.jar —subscription.key=\ —sample.url=\ —face.attributes=\
  • UI mode: Just hit root deployment url (e.g. http://localhost:8080)
  • API mode:
    • Make sure environment variables subscription.key, sample.url and face.attributes are populated
    • Hit /detect endpoint (e.g.http://localhost:8080/detect)
  • Replace the placeholders in application.properties as required
  • Deploy to Pivotal Cloud Foundry (PCF)
    • Launch cf cli from e.g. Azure Cloud Shell
    • cf push (sample manifest provided)
  • User provided services to bind Congnitive Services to an app running in PCF:
    • create UPSI:
      • cf cups cognitive -p ‘{“key”:”—- API key goes here —-“}’
    • bind the service to the app. Make sure to use cognitive as the service name for the binding to work:
      • cf bind-service face-api cognitive
    • restage the app
      • cf restage face-api

[1] https://docs.microsoft.com/en-us/azure/cognitive-services/face/overview