We provide the pre-trained model of Pix2Seq. This version contains new data augmentation. The model is trained for 300 epochs and can acheive 37 mAP without beam search or neucles search.
Install PyTorch 1.5+ and torchvision 0.6+ (recommend torch1.8.1 torchvision 0.8.0)
Install pycocotools (for evaluation on COCO):
pip install -U 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'
That's it, should be good to train and evaluate detection models.
kevin's
pip install timm
Download and extract COCO 2017 train and val images with annotations from http://cocodataset.org. We expect the directory structure to be the following:
path/to/coco/
annotations/ # annotation json files
train2017/ # train images
val2017/ # val images
First link coco dataset to the project folder
ln -s /path/to/coco ./coco
# kevin's
mkdir ./coco
ln -s /path/to/train2014 ./coco/train2014
ln -s /path/to/val2014 ./coco/val2014
ln -s /path/to/annotions ./coco/annotations
download ckpt weight
# kevin's
# train dataset encode
sh train.sh --model pix2seq --resume ./ckpt/checkpoint_e299_ap370.pth --encode_train ./feature/train --batch_size 1
# val dataset encode
sh train.sh --model pix2seq --resume ./ckpt/checkpoint_e299_ap370.pth --encode_val ./feature/val --batch_size 1
Training
sh train.sh --model pix2seq --output_dir /path/to/save
Evaluation
sh train.sh --model pix2seq --output_dir /path/to/save --resume /path/to/checkpoints --eval
Method | backbone | Epoch | Batch Size | AP | AP50 | AP75 | Weights |
---|---|---|---|---|---|---|---|
Pix2Seq | R50 | 300 | 32 | 37.0 | 53.4 | 39.4 | weight |
Qiu Han, Peng Gao, Jingqiu Zhou(Beam Search)
Pix2Seq, DETR