# ViT_MIGraphX ## 目录 - [目录结构](#目录结构) - [项目介绍](#项目介绍) - [环境配置](#环境配置) - [编译运行](#编译运行) - [参考数据](#参考数据) - [历史版本](#历史版本) ## 目录结构 ``` ├── Images ├── Makefile ├── Models │   └── model.onnx ├── Python ├── README.md └── src └── main.cpp ``` ## 项目介绍 ViT是将Transformer应用到视觉领域的模型结构,本项目是ViT模型在MIGraphX推理框架上的分类推理示例 ## 环境配置 推荐使用docker方式运行,提供[光源](https://www.sourcefind.cn/#/service-list)拉取的docker镜像 ``` docker pull image.sourcefind.cn:5000/dcu/admin/base/custom:decode-ffmpeg-dtk23.04 ``` ## 编译运行 ### 编译 ``` git clone https://developer.hpccube.com/codes/modelzoo/vit_migraphx.git cd vit_migraphx make ``` ### 运行 下载推理数据 ``` wget https://storage.googleapis.com/download.tensorflow.org/example_images/flower_photos.tgz tar -zxvf flower_photos.tgz ``` ``` ./ViT_MIGraphX ``` 根据提示选择要运行的示例程序,比如执行 ``` ./ViT_MIGraphX --models=Models/model.onnx --input=flower_photos/daisy/ ``` 运行ViT模型,对daisy图片进行分类 ## 准确率数据 测试数据使用的是[flower_photos](https://storage.googleapis.com/download.tensorflow.org/example_images/flower_photos.tgz),使用的加速卡是DCU Z100 | Engine | Model Path| Data | Accuracy(%) | | :------: | :------: | :------: | :------: | | MIGraphX | models/model.onnx | daisy | 98.4 | | MIGraphX | models/model.onnx | dandelion | 98.1 | | MIGraphX | models/model.onnx | roses | 91.3 | | MIGraphX | models/model.onnx | sunflowers | 97.4 | | MIGraphX | models/model.onnx | tulips | 94.1 | ## 源码仓库及问题反馈 https://developer.hpccube.com/codes/modelzoo/vit_migraphx.git