The repository provides a workflow for processing data, pre-training, and evaluating on the ScreenSpot benchmark.
1. Data Processing
Run pretrain_process.py to generate a dataset of approximately 1M samples for continual pre-training. The output is saved to ../data/sft_train.json.
2. GUI Grounding Pre-training
Use the finetune/finetune_lora_ds.sh script to perform pre-training on the processed dataset.
3. Evaluation
Run screenspot_test.py to evaluate the model on the ScreenSpot benchmark.
# Data Processing
cd pretrain
python pretrain_process.py --mobile_imgs xxxx/combined --web_imgs xxxx/seeclick_web_imgs \
--widgetcap_json xxxx/widget_captioning.json --ricosca_json xxxx/ricosca.json \
--screensum_json xxxx/screen_captioning.json --web_json xxxx/seeclick_web.json \
--coco_imgs xxxx/coco/train2017 --llava_json xxxx/llava_instruct_150k.jsonl
# Pre-training
cd ..
bash finetune/finetune_lora_ds.sh --save-name seeclick_sft --max-length 768 --micro-batch-size 8 \
--save-interval 4000 --train-epochs 3 --nproc-per-node 8 --data-path ./data/sft_train.json \
--learning-rate 3e-5 --gradient-accumulation-steps 1 --qwen-ckpt xxxx/Qwen-VL-Chat \
--pretrain-ckpt xxxx/Qwen-VL-Chat --save-path xxxx/checkpoint_qwen
# Evaluation
cd pretrain
python screenspot_test.py --qwen_path xxxx/Qwen-VL-Chat --lora_path xxxx/checkpoint_qwen/seeclick_sft/checkpoint-20000 \
--screenspot_imgs xxxx/screenspot_imgs --screenspot_test xxxx/ScreenSpot --task all