File size: 2,346 Bytes
16231ab
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
# Photo-only AQ methods compared on (1) our 10-fold CV (same folds / pairs as all results) and (2) the Singapore /
# Shenzhen human-rated street-view panoramas (descriptive only). Every step resumes.
# Options: --revision NAME  --images DIR  --ratings "a.csv b.csv"  --skip-vlm (VLM takes ~3-4 h)  --with-svr (slow)
#          --device cuda  --python python
set -euo pipefail
cd "$(dirname "$0")/.."; source scripts/common/lib.sh
SWITCHES="skip-vlm with-svr"; SKIP_VLM=0; WITH_SVR=0
REVISION="urbansas_whole_yfcc_binaural_v1_yfcc_nogeo_b0_21105_allnew_ref40_usotw4"
IMAGES="/data/Images/Images"; RATINGS="/data/Images/Singapore.csv /data/Images/Shenzhen.csv"
parse_args "$@"
rev="runs_main_all_datasets/direct_aq_dataset_gain/$REVISION"; manifest="$rev/metadata_manifest.csv"
cache="runs_main_all_datasets/photo_aqnet/$REVISION/feature_cache.npz"
out=runs_main_all_datasets/compare_methods
read -r -a ratings <<< "$RATINGS"
run "1 Baseline features (segmentation, Places365, ResNet-50, CLIP)" scripts/model/comparison/extract_baseline_features.py \
    --manifest "$manifest" --images "$IMAGES" --device "$DEVICE"
run "1b SigLIP 2 / PE for the external images" scripts/model/comparison/extract_baseline_features.py --images "$IMAGES" --features siglip pe --device "$DEVICE"
methods=(zhao2023_gbrt zhao2023_rf composition_linear resnet50_ridge clip_b16_ridge dataset_mean ours_krr_siglip_pe)
if [[ $SKIP_VLM != 1 ]]; then
    run "2 VLM zero-shot PAQ ratings (Qwen3-VL-8B)" scripts/model/comparison/rate_paq_vlm.py --manifest "$manifest" --images "$IMAGES" --device "$DEVICE"
    methods+=(vlm_zeroshot)
fi
svr=(); [[ $WITH_SVR == 1 ]] && svr=(--with-svr)
run "3 Comparison: 10-fold CV" scripts/model/comparison/compare_methods.py cv --manifest "$manifest" --cache "$cache" --output-dir "$out" \
    --folds "$rev/cv_folds_final_allscored.csv" --train-exclude-views "$rev/train_exclude_final.csv" \
    --methods "${methods[@]}" ${svr[@]+"${svr[@]}"}
run "4 Comparison: Singapore / Shenzhen human ratings (panoramas)" scripts/model/comparison/compare_methods.py external --manifest "$manifest" \
    --cache "$cache" --folds "$rev/cv_folds_final_allscored.csv" --train-exclude-views "$rev/train_exclude_final.csv" --images "$IMAGES" --ratings "${ratings[@]}" --output-dir "$out" --methods "${methods[@]}" ${svr[@]+"${svr[@]}"}