Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
|
|
4 years ago | |
|---|---|---|
| .. | ||
| fig | 4 years ago | |
| src | 4 years ago | |
| eval.py | 4 years ago | |
| mindpsore_hub_conf.py | 4 years ago | |
| readme.md | 4 years ago | |
The TNT (Transformer in Transformer) network is a pure transformer model for visual recognition. TNT treats an image as a sequence of patches and treats a patch as a sequence of pixels. TNT block utilizes a outer transformer block to process the sequence of patches and an inner transformer block to process the sequence of pixels.
Paper: Kai Han, An Xiao, Enhua Wu, Jianyuan Guo, Chunjing Xu, Yunhe Wang. Transformer in Transformer. preprint 2021.
The overall network architecture of TNT is show below:
Dataset used: Oxford-IIIT Pet
TNT
├── eval.py # inference entry
├── fig
│ └── tnt.png # the illustration of TNT network
├── readme.md # Readme
└── src
├── config.py # config of model and data
├── pet_dataset.py # dataset loader
└── tnt.py # TNT network
To Be Done
After installing MindSpore via the official website, you can start evaluation as follows:
# infer example
GPU: python eval.py --model tnt-b --dataset_path ~/Pets/test.mindrecord --platform GPU --checkpoint_path [CHECKPOINT_PATH]
checkpoint can be downloaded at https://www.mindspore.cn/resources/hub.
result: {'acc': 0.95} ckpt= ./tnt-b-pets.ckpt
| Parameters | ||
|---|---|---|
| Model Version | TNT-B | TNT-S |
| uploaded Date | 21/03/2021 (month/day/year) | 21/03/2021 (month/day/year) |
| MindSpore Version | 1.1 | 1.1 |
| Dataset | ImageNet2012 | ImageNet2012 |
| Input size | 224x224 | 224x224 |
| Parameters (M) | 86.4 | 23.8 |
| FLOPs (M) | 14.1 | 5.2 |
| Accuracy (Top1) | 82.8 | 81.3 |
| Parameters | ||
|---|---|---|
| Model Version | TNT-B | TNT-S |
| uploaded Date | 21/03/2021 (month/day/year) | 21/03/2021 (month/day/year) |
| MindSpore Version | 1.1 | 1.1 |
| Dataset | Oxford-IIIT Pet | Oxford-IIIT Pet |
| Input size | 384x384 | 384x384 |
| Parameters (M) | 86.4 | 23.8 |
| Accuracy (Top1) | 95.0 | 94.7 |
In dataset.py, we set the seed inside "create_dataset" function. We also use random seed in train.py.
Please check the official homepage.
MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios.
C++ Python Text Unity3D Asset C other