Kria™ KV260 Vision AI Starter Kit
|
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 the following two kinds of models: customizations can be made to use other models of the same class either from the AMD 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 2.5.0.
As described in the Hardware Accelerator section, the DPU integrated in the platform uses the B3136 configuration.
The arch.json
used to compile the xmodel for B3136 DPU can be obtained by building the accelerator, but if you will not build all from the start, you can obtain the DPU fingerprint by using the following commands on the target SOM:
xdputil query
You will get some output similar to the following:
...
"kernels":[
{
...
"fingerprint":"0x101000016010406",
...
}
]
Save the fingerprint as arch.json
.
{
"fingerprint":"0x101000016010406"
}
For detailed instructions on obtaining an alternative model from the AMD model zoo or training, pruning, quantizing, and compiling a new model, refer to the Vitis AI User Guide (UG1414).
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/kv260-aibox-reid/share/vvas/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/kv260-aibox-reid/share/vitis_ai_library/models", "run_time_model" : false, "need_preprocess" : true, "performance_test" : false, "debug_level" : 0 }
ReID Config
The “model-name” and “model-path” in
/opt/xilinx/kv260-aibox-reid/share/vvas/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/kv260-aibox-reid/share/vitis_ai_library/models/", "model-name": "personreid-res18_pt", "debug": 0 }
Next Steps¶
Go back to the KV260 SOM AIBox-ReID Design Start Page.