microsoft / TAP

TAP: Text-Aware Pre-training for Text-VQA and Text-Caption, CVPR 2021 (Oral)
MIT License
72 stars 11 forks source link

Text Caption #10

Closed abhinavkcs11 closed 2 years ago

abhinavkcs11 commented 2 years ago

Hello, Great work, kudos. How to run TAP for Text Caption task? I see no instruction to run the code for the Text Caption task.

Thank you

zyang-ur commented 2 years ago

Hi @abhinavkcs11,

Thank you. Please see the following example, feel free to let me know if I could better clarify anything. Thanks :)

python -m torch.distributed.launch --nproc_per_node $num_gpu tools/run.py --tasks vqa --datasets $dataset --model $model --seed $seed --config configs/vqa/$dataset/"$refine_yml".yml --save_dir save/$refine_savedir --resume_file save/$pretrain_savedir/$savename/best.ckpt training_parameters.distributed True

for example (Textcaps)

python tools/run.py --batch_size $batch_size --gpu $gpu --tasks captioning --datasets m4c_textcaps --model m4c_captioner --seed $seed --config configs/captioning/m4c_textcaps/tap_refine.yml --save_dir save/$refine_savedir --resume_file save/pretrained/textcaps_tap_base_pretrain.ckpt training_parameters.distributed True