...
Data directory is the only place where you can store external data files for AdamApp. Files which were placed in this directory will be copied when AdamApp is installed. This directory should be empty if you do not have data files you need to copy.
The data_CV2X directory is a directory where you can place external data files for AdamApp for ambaCV2X. The data_CV5X directory is a directory where you can place external data files for AdamApp for ambaCV5X. If you want to share it between ambaCV2X and ambaCV5X, store the external data file for AdamApp in the data directory and it will be shared. If you want to differentiate external data files for AdamApp between ambaCV2X and ambaCV5X, place them under the data_CV2X and data_CV5X directories.
If you are using the AI accelerator, place the converted binary data under the cnn directory.
⚫ external directory: for external software files used in AdamApp
...
(4) Generate preferences file
Please refer to here to create setting value control file when using setting
value control function. Place the file under skeleton_sample_app/ directory by the name of
appPref.json.
...
Build and create a package of AdamApp after creating and placing the required files for AdamApp.
(1) Read configuration file for the AdamApp execution environment and (2) Execute make
For detailed instructions, please see here if you are using SDK v1.71 or earlier.
If you are using SDK v1.80 or later, please refer here.
Format of configuration file
Configuration file contains essential information to run AdamApp. AdamApp is controlled within Adam execution environment in line with the contents of this file (e.g., at the time of installation or starting). Therefore, installation or starting of AdamApp may fail if the content in this file is incorrect. In addition, this file is also used when AdamApp is packaged, which means that you need to create this file before the execution of make to create AdamApp.
See the configuration.txt of any sample app for specific examples.
${SDK_DIR}/src/adamapp/[any sample app]/configuration.txt
Each term in configuration.txt
Each item has a tag and a value as shown below.
# head of line ‘#’ means comment out
TagName Value
Add a space between TagName and Value for one or more characters, or a tab.
‘#’ placed at the beginning of a sentence means ‘comment out’ whereas, a ‘#’ in the middle of sentence
means otherwise.
Details of each tag is shown in Table 1.4.1-1. Please refer to this table to determine what character can be
used for Value for each tag. Examples are shown below.
# set of the name of execution file of AdamApp
APPLICATION SkeletonSampleApp
# set of version of AdamApp
APPVERSION V0.01
More than one item can be selected. Example is as follows.
# set of the official name of AdamApp
APPNAME0 Sample Application
APPNAME1 サンプルアプリケーション
APPNAME5 esempio di applicazione
Following tag names can be used in the configuration file. The optionality field where ‘M (Mandatory)’ is indicated must be filled. The field can be left blank if it is not indicated as mandatory.
Table 1.4.1-1 Tags written in the configuration file
...
Tag name
...
Description
...
Multi selectable
...
Optionality
...
Application name related information
...
APPLICATION
...
The name of AdamApp execution file. Write the same name as PROG_NAME variable in Makefile. Up to 256 characters using alpha-numeral, hyphen, under score, and period.
...
M
...
APPVERSION
...
AdamApp version information. Up to 7 characters using alpha-numeral and period.
...
M
...
APPNAME
The AdamApp official name Tag name should be a combination of APPNAME + region code. This is because an AdamApp official name supports multiple language.
e.g., APPNAME0 SampleApplication
Tag names of languages are as follows:
APPNAME0:English
APPNAME1:Japanese
APPNAME5:Italian
APPNAME7:French
APPNAME9:German
APPNAME11:Spanish
APPNAME12:Chinese
APPNAME13:Russian
APPNAME14:Portuguese
Please always specify APPNAME0(English). The other languages are optional. Single quote cannot be used. The number of characters is up to 32. Character code must be UTF-8
...
O
...
M
...
Information of release
...
ROMSIZE (*1)
...
ROM size used for AdamApp. ROM size includes not only execution file of AdamApp but also the file size stored in data directory. Whether AdamApp can be installed or NOT is determined depending on these values.
...
M
...
RAMSIZE (*2)
...
RAM size used for AdamApp. Whether AdamApp can be installed or NOT is determined depending on these values. Whether AdamApp can be started or NOT is determined depending on these values when starting AdamApp.
...
M
...
CPURATE (*2)
...
AdamApp CPU usage.
...
M
...
AIACCRATE (*2)
...
Adam App AI Accelerator utilization. Whether AdamApp can be started or NOT is determined depending on these values when starting AdamApp.
...
AIMEMSIZE (*3)
...
Build the ambaCV2X and ambaCV5X extension apps into one file
This article explains how to combine ambaCV2X and ambaCV5X applications into one file. If there is no need to combine them into one file, there is no problem if you do not perform this. Build the ambaCV2X and ambaCV5X apps in advance. As an example, if you build Python's sqlite_app, the following files will be generated.
SQLiteSampleAppPy_V0_1_ambaCV2X.ext
SQLiteSampleAppPy_V0_1_ambaCV2X.zip
SQLiteSampleAppPy_V0_1_ambaCV5X.ext
SQLiteSampleAppPy_V0_1_ambaCV5X.zip
Now, move to the target directory as shown below and run make pack.
Code Block |
---|
cd ${SDK_DIR}/src/adamapp-py/sqlite_app/
make pack |
If successful, the ambaCV2X and ambaCV5X apps will be combined into one file.
SQLiteSampleAppPy_V0_1_ambaCV2X5X.ext
SQLiteSampleAppPy_V0_1_ambaCV2X5X.zip
The above files are available for ambaCV2X and ambaCV5X cameras.
Note |
---|
If the ambaCV2X and ambaCV5X apps are combined into one file, the file size will increase accordingly. The app may not work if the file size is large. Please note that the file size limit varies depending on the camera model and condition. |
Format of configuration file
...
Configuration file contains essential information to run AdamApp. AdamApp is controlled within Adam execution environment in line with the contents of this file (e.g., at the time of installation or starting). Therefore, installation or starting of AdamApp may fail if the content in this file is incorrect. In addition, this file is also used when AdamApp is packaged, which means that you need to create this file before the execution of make to create AdamApp.
See the configuration.txt of any sample app for specific examples.
${SDK_DIR}/src/adamapp/[any sample app]/configuration.txt
Each term in configuration.txt
Each item has a tag and a value as shown below.
# head of line ‘#’ means comment out
TagName Value
Add a space between TagName and Value for one or more characters, or a tab.
‘#’ placed at the beginning of a sentence means ‘comment out’ whereas, a ‘#’ in the middle of sentence
means otherwise.
Details of each tag is shown in Table 1.4.1-1. Please refer to this table to determine what character can be
used for Value for each tag. Examples are shown below.
# set of the name of execution file of AdamApp
APPLICATION SkeletonSampleApp
# set of version of AdamApp
APPVERSION V0.01
More than one item can be selected. Example is as follows.
# set of the official name of AdamApp
APPNAME0 Sample Application
APPNAME1 サンプルアプリケーション
APPNAME5 esempio di applicazione
Following tag names can be used in the configuration file. The optionality field where ‘M (Mandatory)’ is indicated must be filled. The field can be left blank if it is not indicated as mandatory.
Table 1.4.1-1 Tags written in the configuration file
Tag name | Description | Multi selectable | Optionality | |||
---|---|---|---|---|---|---|
Application name related information | APPLICATION | The name of AdamApp execution file. Write the same name as PROG_NAME variable in Makefile. Up to 256 characters using alpha-numeral, hyphen, under score, and period. | M | |||
APPVERSION | AdamApp version information. Up to 7 characters using alpha-numeral and period. | M | ||||
APPNAME | The AdamApp official name Tag name should be a combination of APPNAME + region code. This is because an AdamApp official name supports multiple language. e.g., APPNAME0 SampleApplication Tag names of languages are as follows:
Please always specify APPNAME0(English). The other languages are optional. Single quote cannot be used. The number of characters is up to 32. Character code must be UTF-8 | O | M | |||
Information of release | ROMSIZE (*1) | ROM size used for AdamApp. ROM size includes not only execution file of AdamApp but also the file size stored in data directory. Whether AdamApp can be installed or NOT is determined depending on these values. | M | |||
RAMSIZE (*2) | RAM size used for AdamApp. Whether AdamApp can be installed or NOT is determined depending on these values. Whether AdamApp can be started or NOT is determined depending on these values when starting AdamApp. | Information of script file | INSTALLER | Name of the shell M | ||
CPURATE (*2) | AdamApp CPU usage. This will be used in the response of WEB API getApplicationList. | M | ||||
AIACCRATE (*3) | Adam App AI Accelerator utilization. | |||||
AIMEMSIZE (*3) | AI Memory size used by AdamApp. | |||||
Information of script file | INSTALLER | Name of the shell script that is executed soon after the installation. Only in Bourne Shell format (Bourne Shell compatible ash should be used). Alpha-numeral, hyphen, under score, and period can be used. The number of characters should be within 256. When this shell script is not used, do not indicate any value or comment out this item. | ||||
UPDATER | The name of the shell script executed soon after an update. Only in Bourne Shell format (Bourne Shell compatible ash should be used). Alpha-numeral, hyphen, under score, and period can be used. The number of characters should be within 256. When this shell script is not used, do not indicate any value or comment out this item. | |||||
UNINSTALLER | Name of the shell script executed right before the uninstallation. Only in Bourne Shell format (Bourne Shell compatible ash should be used). Alpha-numeral, hyphen, under score, and period can be used. The number of characters should be within 256. When this shell script is not used, do not indicate any value or comment out this item. | |||||
Information of license | FUNCID | Function ID This is a unique value for each AdamApp which is normally assigned by i-PRO Co., Ltd. This value can link AdamApp to the function ID. The ID should be 8 digit and in hex.
| M |
*1: ROMSIZE
Sum of followings.
Size of executable file and shared libraries (sum of “text” and “data” field value obtained with the
Linux size command.)
Size of data directory.
Size of conf directory.
*2: RAMSIZE, CPURATE, AIACCRATE,
At first, set the same value as the sample application.
At last, set the value when running the application on the i-PRO camera.
How to see these parameters described in here.
Available ROM/RAM resources described in here.
*3: AIACCRATE, AIMEMSIZE
Set the same value as the sample application.
Case of using AI accelerator
Note |
---|
・AI accelerator is available only in AdamApp for i-pro ambaCV2X model. ・Tool(cvtool) is not included in AdamAppSDK. Please contact i-PRO Co., Ltd. if you need one. |
Accelerator (CVFlow) for AI inference process is embedded in i-pro ambaCV2X model IP camera. AdamApp can use the accelerator through a dedicated Adam API. A binary file for accelerator is needed as an input for API. Create a binary file and built it into AdamApp by the following sequence.
Convert a pre-trained AI model into a binary file for accelerator.
Create AdamApp package in accord to here in this document. Place the binary file generated in step 1 under data/cnn directory.
...
A tool (cvtool) to be used to process the step1 above is provided by Adam. Please see here for how to use cvtool.
Appendix
Appendix A: Regarding product security
Please be aware of the following matters to ensure product security throughout the course of your development.
- Perform static analysis
- Verify vulnerability of the app.
- When using OSS, use the latest OSS or check for known vulnerabilities before using.
Appendix B: CPU and RAM available in AdamApp
The CPU usage and RAM usage available in AdamApp varies depending on i-PRO camera model. The camera will restrain AdamApp not to use CPU when CPU usage limit has been reached. AdamApp will be forced to terminate as the memory usage reaches the limit. Please access the URL for usage information for each model.
https://dev-partner.i-pro.com/space/TPFAQ/694780048
Appendix C: About development in Python
Python environment of i-PRO camera
The Python environment pre-installed to the i-PRO camera is shown below.
Interpreter : Python 3.7.9
External library : python adam module for ADAM API
Structure of the Python version AdamApp
The Python version AdamApp runs 2 threads, Main thread and Python thread as shown below.
...
Python scripts are usually executed on Python thread. On the other hand, callback functions such as stopCallback, httpCallback and appPrefCallback are executed on Main thread.
Main thread is created as soon as the Python version AdamApp commences. Then Python thread is created after Main thread completes initializing AdamApp. Python thread then launches Python interpreter, loads pymain.py, and executes Python scripts. Python thread will be automatically terminated once the Python script ends. This is followed by the termination of the Main thread and then AdamApp. These are not used in internal processing.
Appendix
...
Appendix A: Regarding product security
Please be aware of the following matters to ensure product security throughout the course of your development.
- Perform static analysis
- Verify vulnerability of the app.
- When using OSS, use the latest OSS or check for known vulnerabilities before using.