ML-Decoder pre-trained models

March 31, 2022 ยท View on GitHub

In addition to full reproduction code, we provide a collection of pretrained models with an ML-Decoder classification head.

BackboneInput SizeDatasetmAP
TResNet_M 224MS-COCO84.2
TResNet_L448MS-COCO90.1
TResNet_XL640MS-COCO91.4
TResNet_M224OpenImages86.8
TResNet_L384Stanford-Cars96.41

MS-COCO Validation Code

After downloading the models, you can validate their MS-COCO scores using the following script:

python validate.py  \
--model-name=tresnet_l \
--model-path=./models_zoo/tresnet_l_COCO__448_90_0.pth \
--image-size=448 \
--data=/home/MSCOCO_2014/

MS-COCO Inference Code

We also provide an inference code, that demonstrate how to load our model, pre-process an image and do actuall inference. Example run of MS-COCO model (after downloading the relevant model):

python infer.py  \
--model-name=tresnet_l \
--model-path=./models_zoo/tresnet_l_COCO__448_90_0.pth \
--pic-path=./pics/000000000885.jpg \
--image-size=448

which will result in:

Open Images Inference Code

python infer.py  \
--model-name=tresnet_m \
--model-path=./models_zoo/tresnet_m_open_images_200_groups_86_8.pth \
--pic-path=./pics/000000000885.jpg \
--image-size=224 \
--num-of-groups=200 \
--num-classes=9605 \
--th=0.97

which will result in: