You should prepare the TensorRT>=7.0 and cuda>=10.0 environment!
pip install -r requirement.txt
# or
# find torch version in https://pytorch.org/get-started/previous-versions/, e.g.
pip install torch==1.10.1+cu111 torchvision==0.11.2+cu111 -f https://download.pytorch.org/whl/torch_stable.html
pip install pycocotools==2.0.2 timm==0.4.9 numpy fvcore Cython matplotlib opencv-python tqdm thop torchstat
then, you should run this commond to download the pretrained models!
python down_pretrained_model.py
resnet, swin-transformer, regnet....
FCOS, CenterNet, TTFNet
Introduction based on CenterNet!
Firstly, modify your dataset file frame
COCO2017
|
|-----annotations----instances_train2017(or val).json
|
|-----train2017
|-----val2017
modify the data_path and other necessary params in the config file([config_centernet.py])
base_path = '/your coco frame data path/'
cd ./train
./train.sh
cd ./tools
python eval.py
cd ./tools
python inference.py
show per class metrics, such as: ap precision recall f1
save FP FN images
cd ./tools
python json_analysis.py
convert pytorch model to TRT model or RK model
tensorrt: trt_fp16.py pt2trt.py pt2onnx2trt.py
rk: export_trace_model.py convert_rknn.py