Skip to content

Latest commit

 

History

History
64 lines (46 loc) · 1.98 KB

File metadata and controls

64 lines (46 loc) · 1.98 KB

II. Call services

II.1. List avaible services

The curl command is:

curl \
    -H "User-Token: ${username}" \
    -H "Accept-Token: ${password}" \
    https://demo.noos.cloud:9001/available_services

The output is in JSON and is a bit ugly in the terminal. If you have installed python in your computer, you can add | python -m json.tool to beautify the JSON received.

Another solution is to npm install -g prettyjson and do the same: | prettyjson

II.2. Call services

II.2.a Basic example

Note We support a call done from the web browser. However, the web browser keeps the connection open until the browser it is closed, having the following inconvenience: If the browser doesn't send messages with the platform for more than 60 seconds, the server close the connection but the browser keep that connection open instead of creating a new one. Therefore, the next time you try to do a call from the browser, the server is not going to allow that communication. You have to close the window with your program and open it again.


Here is the list of computer vision services that we offer:

  • face_recognition
  • face_detection
  • human_detection
  • qr_recognition
  • age_detection
  • gender_detection
  • face_expression

All this services can be called with POST request, the form must be of type multipart-data and contain a binary image field.

An example for face_detection would be in bash:

curl \
    -H "User-Token: ${username}" \
    -H "Accept-Token: ${password}" \
    -F "filename=@../data/face.jpg" \
    https://demo.noos.cloud:9001/face_detection

If we want to translate this to Javascript, you have an example in examples/basic_example/basic_example.js.

To make it work, please create a file ".noos_credentials" with on the first line your username and your password on the second.

II.2.b Advanced example

To see how to call all the different services of the platform, please the check the advanced example contained in examples/advanced_example.