This is templete code of pytorch, which used in classification task.
- pretrained weights download
you can download pretrained weights from Google Drive.Unzip and place them in PROJECT_DIR/weights.
Ensuring the directory is as follows:
classification_pytorch
└── weights
├── shufflenetv2_x0.5-f707e7126e.pth
├── shufflenetv2_x1-5666bf0f80.pth
└── mobilenetv3_large_100-427764d5.pth
- data prepare
you can prepare your dataset and modify the path indataset/get_pkl.py
python dataset/get_pkl.py
the train.pkl and test.pkl are generated in dataset dir
- train
set your train config inconfig/config.yml
python main/train.pyyour train weights will be saved in expriments dir,named with time_stamp: YYY_MMMM_DDD_TTT
the log and eval_badcase will be saved in log dir,you can review the train log.
- inference
modify thedemo.pyroot and weight path
python main/demo.py- convert onnx
modify the weight path and generate onnx
python main/deploy.py