Multi-label person/train classification
🚀 Train
1. Install all necessary libs:
pip3 install -r requirements.txt
Note: if you are using a GPU, then you need to install CUDA and replace the torch version in requirements.txt
with the GPU-enabled version.
Otherwise, the processor will be used.
config.py
(can skip)
2. Edit 3. Run the training script with the arguments:
python3 train.py --model=resnet34 --pretrained=True --epoch_num=40 --checkpoints=ckpts
you can choose as the model
argument:
- ResNet18 ('resnet18')
- ResNet34 ('resnet34')
- ResNet50 ('resnet50')
- Efficientnet b0-b7 ('efficientnet-b0' etc.)
✅ Inference
inference.py
, specifying the required architecture, the path to the model and the image in the arguments:
Run python3 inference.py --model_arch=resnet34 --ckpt=model.ckpt --image_path=image.jpg