This repository provides sample code for a Flask Web API that uses Console Access Library for Python to respond inference results to a frontend application (aitrios-sample-application-check-data-tool-ts), as well as configuration files for building a development environment. This application builds an API to retrieve and return object detection based metadata from AITRIOS | Console.
-
Clone or fork this application in your GitHub environment.
-
Click the
+
button to create a codespace on the GitHub environment. See how to create a codespace. -
Create console access setting configuration file with real values under src/data_loader/common/config/.
src/data_loader/common/console_access_settings.yaml
console_access_settings: console_endpoint: "__console_endpoint__" portal_authorization_endpoint: "__portal_authorization_endpoint__" client_secret: "__client_secret__" client_id: "__client_id__"
Note
- Specify the base URL
- Specify the token URL
- Specify registered application secret for client_secret
- Specify registered application client ID for client_id
See the Portal user manual for details.
-
Run the sample application using the following command.
$ cd ./src $ flask run --debugger --reload
-
Open
localhost:5000
in a browser and verify that the application is running.Note Please check only for codespaces users!
Public Ports (Front-end application link)
To link with the front-end application, follow the steps below to make the port on codespaces public.- Open a terminal and open the [Port] tab. Right-click on the port that will be shared and, after clicking on [Port Display Range], click on [Public].
- Click on the copy icon on the right side of the port’s local adress and copy it.
- Web API to obtain various datas from AITRIOS | Console.
- An API that can be obtained a list of edge AI devices connected to the AITRIOS | Console.
- An API that can be obtained a list of sub-directories containing images taken with the specified device.
- An API that can be obtained a list of pairs of image and inference result that stored in the Console.
- Only object detection made by Custom Vision is supported.
- It can be run on devcontainer/codespaces.
None
Before using Codespaces, please read the Site Policy of GitHub and understand the usage conditions.