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 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 Console.
- An API that can be obtained a list of Edge Devices connected to 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 Console.
- Only object detection made by Custom Vision is supported.
- It can be run on devcontainer/codespaces.
- Only images and inference results up to 10 hours after the inference start time can be acquired.
Before using Codespaces, please read the Site Policy of GitHub and understand the usage conditions.