AI model conversion

 

Introduction


Please contact us from here to download tool.

Docker files will be provided after receiving approval from Ambarella. Therefore, it will take a few days from sending the request till we send the Docker file.

 

Docker file version history


If there are no problems with the tools you are currently using, updating the tools is not required.

Jun 4, 2024 v1.21

  • Added yolov8 to ONNX sample.

Jan 23, 2024 v1.20

  • Updated CV tool provided by SoC vender (CNNGen Ver.2.5.6.0.1245)

  • Updated DnnSdApp to v0.5
    Added setting items for AI model input. Please refer here for details.

  • Update Document

Apr 12, 2023 v1.19

  • Updated CV tool provided by SoC vender (CNNGen Ver.2.5.2.0.1210)

Jan 19, 2023 v1.18

  • Updated CV tool provided by SoC vender (CNNGen Ver.2.4.2.12.1113)

Dec 28, 2022 v1.17

  • End of support for SSD using caffe

  • Update Document

Sep 13, 2022 v1.16

  • Updated CV tool provided by SoC vender

  • Note: Caffe SSD model cannot be converted. Please contact us if you have an urgent request.

 

Overview


In developing additional application with AI, trained AI model on Caffe/Tensorflow/ONNX framework needs to be convert to binary file (cavalry.bin), which is executed by accelerator H/W (CVFlow) embedded to AI camera.

The CV tool processes this conversion.

  • The target users of this document are supposed to have skill of training AI model.

  • The cvtool is not the tool for training AI model.
    Users have to train it in each framework in advance.

  • The cvtool handles CNN as target AI model.

  • The model of tensorflow v2.x needs to be converted to tflite or ONNX in advance.

  • Pytorch model needs to be converted to ONNX in advance

  • Different binary file (cavalry.bin) is required for ambaCV2X camera and ambaCV5X camera.

 

Development Flow


The CV Tool handles colored items in the figure below.

Retraining of a model is not included in this process.

AI camera’s accelerator H/W (CVFlow) performs in 16bit or 8bit fixed point operation, so data length of trained model is quantized into 16bit or 8bit.

The user can select the quantization setting from the following three types.

  • only 16bit

  • 16bit/8bit mixed (the CV tool decides data length of each operation)

  • only 8bit

The inference time of 8bit operation is faster but less accurate compared to 16bit operation.

 

Preparation


Please refer here for the environment construction procedure.

 

Conversion


Please refer to the following pages for model conversion.

 AI model convert tool: Caffe

 AI model convert tool: Tensorflow

 AI model convert tool: ONNX/PyTorch

 

Limitation of liability


  • This tool provides the features for developing additional application executed in security cameras. The behavior of developed application is not guaranteed. In addition, the embedded features will not be guaranteed after installing additional application to the camera.

  • The provided sample files are only to show users how to use this tool and that they are not practically used for actual surveillance system.

  • In no event shall i-PRO Co., Ltd. be liable to any party or any person, except for replacement or reasonable maintenance of the product, for the cases, including but not limited to below;

    • Any damage and loss, including without limitation, direct or indirect, special, consequential or exemplary, arising out of or relating to the product;

    • Personal injury or any damage caused by inappropriate use or neglect operation of the user;

    • Any problems, consequential inconvenience, or loss or damage, arising out of the reverse compiling or reverse engineering of the product;

    • Any loss or damage, or claims arising out from loss or leak of PS data including video data in the PC;

    • Any claim or action for damages, brought by any person or organization being a photogenic subject, due to violation of privacy with the result of that surveillance camera's picture, including saved data, for some reason, becomes public or is used for the purpose other than surveillance;