Skip to content

Commit 1455738

Browse files
Merge pull request #5 from SonySemiconductorSolutions/release/1.0.3
release/1.0.3 to main
2 parents 6d08c3d + 93f4931 commit 1455738

File tree

4 files changed

+51
-48
lines changed

4 files changed

+51
-48
lines changed

README.md

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Tutorial Checkdata: Sample Application on AITRIOS
22

33
## Contents
4+
45
- [Contents](#contents)
56
- [Overview](#overview)
67
- [Get Started](#get-started)
@@ -13,20 +14,20 @@
1314
- [Trademark](#trademark)
1415
- [Notice](#notice)
1516

16-
1717
## Overview
1818

19-
This repository provides sample code for a [Flask](https://flask.palletsprojects.com/en/2.3.x/) Web API that uses [Console Access Library for Python](https://github.com/SonySemiconductorSolutions/aitrios-sdk-console-access-lib-python) to respond inference results to a [frontend application (aitrios-sample-application-check-data-tool-ts)](https://github.com/SonySemiconductorSolutions/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.
19+
This repository provides sample code for a [Flask](https://flask.palletsprojects.com/en/2.3.x/) Web API that uses [Console Access Library for Python](https://github.com/SonySemiconductorSolutions/aitrios-sdk-console-access-lib-python) to respond inference results to a [frontend application (aitrios-sample-application-check-data-tool-ts)](https://github.com/SonySemiconductorSolutions/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.
2020

2121
## Get Started
2222

2323
### Build an environment and get started with the sample application
2424

2525
1. Clone or fork this application in your GitHub environment.
2626
2. Click the `+` button to create a codespace on the GitHub environment. See [how to create a codespace](https://docs.github.com/en/codespaces/developing-in-codespaces/creating-a-codespace-for-a-repository).
27-
3. Create console access setting configuration file with real values under [src/data_loader/common/config/](./src/data_loader/common/config/console_access_settings.yaml.sample).
27+
3. Create console access setting configuration file with real values under [src/data_loader/common/config/](./src/data_loader/common/console_access_settings.yaml.sample).
2828
`src/data_loader/common/console_access_settings.yaml`
29-
```
29+
30+
```yaml
3031
console_access_settings:
3132
console_endpoint: "__console_endpoint__"
3233
portal_authorization_endpoint: "__portal_authorization_endpoint__"
@@ -35,39 +36,40 @@ This repository provides sample code for a [Flask](https://flask.palletsprojects
3536
```
3637
3738
> **Note**
38-
> * Specify the base URL
39-
> * Specify the token URL
40-
> * Specify registered application secret for client_secret
41-
> * Specify registered application client ID for client_id
39+
> - Specify the base URL
40+
> - Specify the token URL
41+
> - Specify registered application secret for client_secret
42+
> - Specify registered application client ID for client_id
4243
43-
See the [Portal user manual](https://developer.aitrios.sony-semicon.com/documents/portal-user-manual/) for details.
44+
See the [Portal user manual](https://developer.aitrios.sony-semicon.com/en/edge-ai-sensing/documents/portal-user-manual/) for details.
4445
4. Run the sample application using the following command.
45-
```
46+
47+
```sh
4648
$ cd ./src
4749
$ flask run --debugger --reload
4850
```
51+
4952
5. Open `localhost:5000` in a browser and verify that the application is running.
5053

5154
> **Note**
5255
> Please check only for codespaces users!
53-
>
56+
>
5457
> **Public Ports (Front-end application link)**
5558
> To link with the front-end application, follow the steps below to make the port on codespaces public.
5659
> 1. 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].
5760
> 2. Click on the copy icon on the right side of the port’s local adress and copy it.
58-
>
61+
>
5962

6063
![codespace_public_port](./docs/20230704_codespace_public_port.png)
6164

62-
6365
## Specifications
6466

6567
### Functional overview
6668

67-
- Web API to obtain various datas from AITRIOS | Console.
68-
- An API that can be obtained a list of edge AI devices connected to the AITRIOS | Console.
69+
- Web API to obtain various datas from Console.
70+
- An API that can be obtained a list of Edge Devices connected to Console.
6971
- An API that can be obtained a list of sub-directories containing images taken with the specified device.
70-
- An API that can be obtained a list of pairs of image and inference result that stored in the Console.
72+
- An API that can be obtained a list of pairs of image and inference result that stored in Console.
7173
- Only object detection made by Custom Vision is supported.
7274
- It can be run on devcontainer/codespaces.
7375

@@ -77,19 +79,20 @@ None
7779

7880
## Get support
7981

80-
- [Contact us](https://developer.aitrios.sony-semicon.com/contact-us/)
82+
- [Contact us](https://developer.aitrios.sony-semicon.com/en/edge-ai-sensing/contact-us/)
8183

8284
## See also
83-
- [Get Started](https://developer.aitrios.sony-semicon.com/development-guides/get-started)
85+
86+
- [Get Started](https://developer.aitrios.sony-semicon.com/en/edge-ai-sensing/guides/)
8487
- [aitrios-sdk-console-access-lib-python](https://github.com/SonySemiconductorSolutions/aitrios-sdk-console-access-lib-python)
8588
- [aitrios-sdk-cloud-app-sample-python](https://github.com/SonySemiconductorSolutions/aitrios-sdk-cloud-app-sample-python)
8689

87-
8890
## Trademark
89-
- [Read This First](https://developer.aitrios.sony-semicon.com/development-guides/documents/read-this-first/)
91+
92+
- [Read This First](https://developer.aitrios.sony-semicon.com/en/edge-ai-sensing/guides/)
9093

9194
## Notice
9295

9396
### Security
9497

95-
Before using Codespaces, please read the Site Policy of GitHub and understand the usage conditions.
98+
Before using Codespaces, please read the Site Policy of GitHub and understand the usage conditions.

jupyter_notebook/cloud_sdk_tutorial.ipynb

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@
3333
"cell_type": "markdown",
3434
"metadata": {},
3535
"source": [
36-
"## Step1 AITRIOSに接続されているDevice一覧情報を取得する\n",
36+
"## Step1 Consoleに接続されているエッジデバイス一覧情報を取得する\n",
3737
"\n",
38-
"- 1. Clientの取得\n",
39-
"- 2. AITRIOSに接続されているDevice一覧情報の取得\n",
38+
"- 1. クライアントの生成\n",
39+
"- 2. Consoleに接続されているエッジデバイス一覧情報の取得\n",
4040
"\n",
41-
"### 1. Clientの取得\n",
41+
"### 1. クライアントの生成\n",
4242
"\n",
43-
"* `get_console_client`関数を呼び出し、`console_access_settings.yaml`に記載されている接続先情報を用いてAITRIOSに接続するためのClientを作成します\n",
43+
"* `get_console_client`関数を呼び出し、`console_access_settings.yaml`に記載されている接続先情報を用いてConsoleに接続するためのクライアントを生成します\n",
4444
"* `/workspace/src/data_loader/common/`に`console_access_settings.yaml`を作成し、`console_access_settings_dir`にファイルパスを記述してください。\n",
4545
"\n",
4646
"```yaml:console_access_settings.yaml\n",
@@ -81,11 +81,11 @@
8181
"cell_type": "markdown",
8282
"metadata": {},
8383
"source": [
84-
"### 2. Deviceの一覧情報の取得関数の作成\n",
84+
"### 2. エッジデバイスの情報を取得する関数の作成\n",
8585
"\n",
8686
"以下の機能を持つ`get_devices`関数を作成します。\n",
87-
"1. `client_obj.device_management.get_devices()`を実行し、デバイス情報を取得\n",
88-
"2. 取得したデバイス情報をid_listに格納し、戻り値として返す"
87+
"1. `client_obj.device_management.get_devices()`を実行し、エッジデバイス情報を取得\n",
88+
"2. 取得した情報をid_listに格納し、戻り値として返す"
8989
]
9090
},
9191
{
@@ -137,7 +137,7 @@
137137
"cell_type": "markdown",
138138
"metadata": {},
139139
"source": [
140-
"## Step2 選択されたDeviceにおける画像ディレクトリ情報を取得する\n",
140+
"## Step2 選択されたエッジデバイスの画像保存先ディレクトリ一覧を取得する\n",
141141
"\n",
142142
"以下の機能を持つ`get_image_directories`を作成します。\n",
143143
"1. 前セルで取得したdevice名を`client_obj.insight.get_image_directories`の引数にして実行し、device名に紐づいた画像フォルダ名を取得"
@@ -193,7 +193,7 @@
193193
"以下の機能を持つ`device_images`を作成します。\n",
194194
"1. 前セルで取得した画像フォルダの中の1つを引数とし、フォルダ内の画像群を取得する`client_obj.insight.get_images`の実行\n",
195195
"\n",
196-
"2. device_imagesを実行後、画像群から1枚選択し、描画します。\n",
196+
"2. device_imagesを実行後、画像の中からから1枚選択し描画\n",
197197
"\n",
198198
"**注意!** \n",
199199
"レクチャーではbase64でエンコードされた画像の文字列をpythonの標準ライブラリ`base64`でデコード後、`PIL`を使用して画像を表示しています。\n",
@@ -390,9 +390,9 @@
390390
"cell_type": "markdown",
391391
"metadata": {},
392392
"source": [
393-
"## Step5 推論結果をDeserializeする\n",
393+
"## Step5 取得した推論結果をDeserializeする\n",
394394
"\n",
395-
"[smart-camera-tutorial-checkdata-python](https://github.com/SonySemiconductorSolutions/smart-camera-tutorial-checkdata-python)で提供されているDeserializeコードを用いてデータをbase64のデコードおよび、FlatBuffersによるデシリアライズを行います\n",
395+
"[smart-camera-tutorial-checkdata-python](https://github.com/SonySemiconductorSolutions/smart-camera-tutorial-checkdata-python)で提供されているDeserializeコードを用いて、データのデコードとFlatBuffersによるDeserializeを行います\n",
396396
"\n",
397397
"\n",
398398
"<details><summary>get_deserialize_data.py</summary>\n",
@@ -433,19 +433,19 @@
433433
"`get_deserialize_data.py`に関して詳細な説明を記載します。\n",
434434
"\n",
435435
"1. 初めに、`src.common.deserialize`以下にあるFlatBuffersスキーマをimportします。\n",
436-
" - AITRIOS Console上のpresetで提供されているobject detectionのpplを使用する場合はこちらのファイルの修正は不要です\n",
436+
" - Console上のpresetで提供されているobject detectionモデルに対応したエッジアプリケーションを使用する場合は、こちらのファイルの修正は不要です\n",
437437
"\n",
438438
"```python\n",
439439
"from src.common.deserialize import ObjectDetectionTop, BoundingBox, BoundingBox2d\n",
440440
"```\n",
441441
"\n",
442-
"2. AITRIOS Consoleから取得した推論結果データをbase64でデコードします。\n",
442+
"2. Consoleから取得した推論結果データをbase64でデコードします。\n",
443443
"\n",
444444
"```python\n",
445445
"buf_decode = base64.b64decode(serialize_data)\n",
446446
"```\n",
447447
"\n",
448-
"3. FlatBuffersのライブラリがWrapされている`ObjectDetectionTop`を使用して指定された前段でデコードされたデータ`buf_decode`をデシリアライズします。その後、`Perception`によってデータをpythonのlist型に変換します。\n",
448+
"3. FlatBuffersのライブラリがWrapされている`ObjectDetectionTop`を使用して指定された前段でデコードされたデータ`buf_decode`をDeserializeします。その後、`Perception`によってデータをpythonのlist型に変換します。\n",
449449
"\n",
450450
"```python\n",
451451
"ppl_out = ObjectDetectionTop.ObjectDetectionTop.GetRootAsObjectDetectionTop(buf_decode, 0)\n",
@@ -519,7 +519,7 @@
519519
"source": [
520520
"## Step6 推論結果を画像に重ね合わせる\n",
521521
"\n",
522-
"前セルでデシリアライズした結果をopencvライブラリを用いて、画像に矩形として描画します。"
522+
"前セルでDeserializeした結果をopencvライブラリを用いて、画像に矩形として描画します。"
523523
]
524524
},
525525
{

jupyter_notebook/cloud_sdk_tutorial_en.ipynb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@
3333
"cell_type": "markdown",
3434
"metadata": {},
3535
"source": [
36-
"## Step1 Retrieve the Device list information connected to AITRIOS \n",
36+
"## Step1 Retrieve the Device list information connected to Console \n",
3737
"\n",
38-
"- 1. Retrieving the Client\n",
39-
"- 2. Retreving the Device list information connected to AITRIOS\n",
38+
"- 1. Create a client to connect to Console\n",
39+
"- 2. Retrieve the Edge Device list information connected to Console\n",
4040
"\n",
4141
"### 1. Retrieving the Client\n",
4242
"\n",
43-
"* Call the `get_console_client` function and, using the connection destination information described in `console_access_settings.yaml`, a Client used to connect to AITRIOS is created. For information on how to create a Client, refer to [REST API authentication](https://developer.aitrios.sony-semicon.com/en/file/download/rest-api-authentication).\n",
43+
"* Call the `get_console_client` function and, using the connection destination information described in `console_access_settings.yaml`, a client used to connect to Console is created. For information on how to create a client, refer to [REST API authentication](https://developer.aitrios.sony-semicon.com/en/file/download/edge-ai-sensing-portal-console-end-point-info/).\n",
4444
"* It is assumed that the `console_access_settings.yaml` file is placed in the same directory as `tutorial_sample.ipynb` but is is also possible to place it elsewhere by editing the file path of `console_access_settings_dir` according to what is needed.\n",
4545
"\n",
4646
"```yaml:console_access_settings.yaml\n",
@@ -81,11 +81,11 @@
8181
"cell_type": "markdown",
8282
"metadata": {},
8383
"source": [
84-
"### 2. Creating a function to retrieve the Device list information\n",
84+
"### 2. Creating a function to retrieve the Edge Device list information\n",
8585
"\n",
8686
"Create the `get_devices` function with the following functionalities. \n",
87-
"1. Execute `client_obj.device_management.get_devices()` and retrieve the Device information\n",
88-
"2. Store the obtained device information in id_list and return it. "
87+
"1. Execute `client_obj.device_management.get_devices()` and retrieve the Edge Device information\n",
88+
"2. Store the obtained device information in id_list and return it"
8989
]
9090
},
9191
{
@@ -140,7 +140,7 @@
140140
"## Step2 Retrieve the image directory information for the selected Device \n",
141141
"\n",
142142
"Create the `get_image_directories` function that has the following functionality. \n",
143-
"1. Using the Device name retrieved earlier as an argument of `client_obj.insight.get_image_directories`, retrieve the image folder name associated with the Device name. "
143+
"1. Using the Device name retrieved earlier as an argument of `client_obj.insight.get_image_directories`, retrieve the image folder name associated with the Edge Device name. "
144144
]
145145
},
146146
{
@@ -432,13 +432,13 @@
432432
"`get_deserialize_data.py` is explained in detail below. \n",
433433
"\n",
434434
"1. First, the FlatBuffers schema under `src.common.deserialize` is imported.\n",
435-
" - If the object detection ppl provided by the preset of the AITRIOS Console is being used, this file does not need to be modified.\\\n",
435+
" - If the object detection ppl provided by the preset of Console is being used, this file does not need to be modified.\\\n",
436436
"\n",
437437
"```python\n",
438438
"from src.common.deserialize import ObjectDetectionTop, BoundingBox, BoundingBox2d\n",
439439
"```\n",
440440
"\n",
441-
"2. The inference result data retrieved from the AITRIOS Console is decoded using base64. \n",
441+
"1. The inference result data retrieved from Console is decoded using base64. \n",
442442
"\n",
443443
"```python\n",
444444
"buf_decode = base64.b64decode(serialize_data)\n",

0 commit comments

Comments
 (0)