Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Image processing through API works on the principle of sending the image via HTTP request and getting a response with the result (contains /wiki/spaces/KB3141/pages/533529551 Context by default, but there are also other response types available). Only one image can be sent per request.

...

You can add extra information to the request. This string will be added to the context (the key is data). It is available only in the /wiki/spaces/KB3141/pages/533529462 Code module (context variable).

Code Block
languagepy
'http://127.0.0.1:8000/analyze_image?data=SomeInfo'

In the Code module, you can access this string using:

...

context – a serialized context in JSON format. The contents are explained on the /wiki/spaces/KB3141/pages/533529551 Context page. You can access the context json from the response using:

...

This displays the testing app, where you can choose to display the last processed image or send a new image to analyze. You can choose the Response type - /wiki/spaces/KB3141/pages/533529551 Context, Image, Annotated image (image with a heatmap), or Heatmap. If the project has Secure image analyze enabled, you also need to enter the API key.

...

If Analyze image is chosen, you can also select the image that will be sent through the API. If the response type is different than the /wiki/spaces/KB3141/pages/533529551 Context, the default behavior is that the image is sent in the body of the response and the context is sent in the headers - to change this and send both in the body, check the box with Context in the body. The detail of the request structure will be displayed.

After you click Send, you will also see the structure of the response in the blue info box, context (as you would see it in /wiki/spaces/KB3141/pages/534446081 Inspection), and optionally an image based on the response type.

...