Versal VCK5000 开发卡使用下列步骤来为 Alveo U50LV 和 U55C 数据中心加速器卡运行示例:
- 下载 Vitis AI Library 后,导航到 Vitis-AI 目录,然后启动 Docker。
- 输入样本的目录,然后对其进行编译。以 resnet50 为例。
cd /workspace/demo/Vitis-AI-Library/samples/classification bash -x build.sh
- 运行样本。
./test_jpeg_classification resnet50 sample_classification.jpg
如需以批处理模式运行程序,即,DPU 同时处理多张图像,则必须根据 设置主机 部分中的指示信息来对整个 Vitis AI Library 进行编译。随后,将在如下位置生成批处理程序:build_dir_default。输入 build_dir_default,以 facedetect 为例,执行以下命令。./test_classification_batch resnet50 <img1_url> [<img2_url> ...]
- 要运行视频示例,请运行以下命令:
./test_video_classification resnet50 <video_input.mp4> -t 8
其中,video_input.mp4 是您必须为输入准备的视频文件,
-t
则是线程数。 - 要测试模型性能,请运行以下命令:
./test_performance_classification resnet50 test_performance_classification.list -t 8 -s 60
此处,
-t
是线程数,-s
是秒数。要查看参数信息列表,请输入
-h
。注释: 这样即可以批处理模式自动测试程序。