Versions Compared

Key

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

REST API - Send Image to PEKATImage processing through API works on the principle of sending the image via HTTP request and getting a response with the result (Context by default). Only one image can be sent per request. (MODIFY & DELETE)

Widget Connector
overlayyoutube
_templatecom/atlassian/confluence/extra/widgetconnector/templates/youtube.vm
width680px
urlhttps://www.youtube.com/watch?v=WkEYKFe9wMo&feature=youtu.be
height400px

...

Code Block
languagepy
'http://127.0.0.1:8000/analyze_image?api_key=SUPER_SECRET'

Example of sending Python code which sends images from a folder to Pekat project with API key:

Code Block
breakoutModewide
languagepy
import requests
import os

request_session = requests.Session()

for image in os.listdir('images_folder'):
    with open(os.path.join('images_folder', image), 'rb') as image:
        response = requests.post(
            url='http://127.0.0.1:8000/analyze_image?api_key=728a9180-8357-11ec-b645-e917eb5f5d27',
            data=image.read(),
            headers={'Content-Type': 'application/octet-stream'}
        )
        
        print(response.json())

...