Kria™ KV260 Vision AI Starter Kit
AIBox-ReID Tutorial

Customizing the AI Models used in the application

Customizing the AI Models used in the application

Introduction

This document provides an overview of how to customize the AIBox-ReID application to use other AI models other than the default ones.

Prerequisites

As the AIBox-ReID application is using two kinds of models listed below, customization can be made to use other models of the same class either from Vitis AI Library or retrained by the user.

  • Pedestrian detection (refinedet_pruned_0_96)

  • ReID (personreid-res18_pt)

Model Preparation

Note The design currently only supports Vitis AI 1.3.0

The arch.json used to compile the xmodel for B3136 DPU can be obtained by build the accelerator, but if you won’t build all from the start, you can just save following code as arch.json file.

{
    "fingerprint":"0x1000020F6014406"
}

For detailed instructions on obtaining an alternative model from the Xilinx model zoo or training, pruning, quantizing, and compiling a new model, please refer to the Vitis AI 1.3.0 documentation - [link to do]

Note As described in the Hardware Accelerator section, the DPU integrated in the platform uses the B3136 configuration.

Configuration files:

To integrate a different .xmodel into the AIBox application, the following configuration files must be updated accordingly:

  • Pedestrian Detection Config

    The “model-name” and “model-path” in /opt/xilinx/share/ivas/aibox-reid/refinedet.json can be customized to use different pedestrian models xmdel file at ${model-path}/${model-name}/${model-name}.xmodel

    "config": {
        "model-name" : "refinedet_pruned_0_96",
        "model-class" : "REFINEDET",
        "model-path" : "/opt/xilinx/share/vitis_ai_library/models/aibox-reid",
        "run_time_model" : false,
        "need_preprocess" : true,
        "performance_test" : false,
        "debug_level" : 0
    }
  • ReID Config

    The “model-name” and “model-path” in /opt/xilinx/share/ivas/aibox-reid/reid.json can be customized to use different ReID models xmdel file at ${model-path}/${model-name}/${model-name}.xmodel

    "config": {
        "model-path": "/opt/xilinx/share/vitis_ai_library/models/kv260-aibox-reid/",
        "model-name": "personreid-res18_pt",
        "debug": 0
    }

Next Steps

References

  • Vitis AI User Guide (UG1414)

License

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License.

You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright© 2021 Xilinx