(from https://www.kaggle.com/datasets/ifigotin/imagenetmini-1000)
Shape : (1,3,224,224)
class_count=3
+ idx=0
category=981[ballplayer, baseball player ]
prob=8.67708683013916
+ idx=1
category=615[knee pad ]
prob=5.741599082946777
+ idx=2
category=880[unicycle, monocycle ]
prob=5.625770568847656
Automatically downloads the onnx and prototxt files on the first run. It is necessary to be connected to the Internet while downloading.
For the sample image,
$ python3 swin_transformer.py
If you want to specify the input image, put the image path after the --input
option.
$ python3 swin_transformer.py --input IMAGE_PATH
By adding the --video
option, you can input the video.
If you pass 0
as an argument to VIDEO_PATH, you can use the webcam input instead of the video file.
$ python3 swin_transformer.py --video VIDEO_PATH
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
Pytorch
ONNX opset = 11