akhilgakhar / wsol_model_selection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pytorch code for: Realistic Model Selection for Weakly Supervised Object Localization

Citation:

@InProceedings{murtaza_2024_wsol_model_selection,
  title   = {Realistic Model Selection for Weakly Supervised Object Localization},
  author  = {S. Murtaza and S. Belharbi and M. Pedersoli and E. Granger},
  journal = {CoRR},
  year    = {2024}
}

Issues:

Please create a github issue.

Requirements

See full requirements at ./dependencies/requirements.txt

cdir=$(pwd)
cd dlib/crf/crfwrapper/bilateralfilter
swig -python -c++ bilateralfilter.i
python setup.py install
cd $cdir
cd dlib/crf/crfwrapper/colorbilateralfilter
swig -python -c++ colorbilateralfilter.i
python setup.py install

See folds/wsol-done-right-splits/dataset-scripts. For more details, see wsol-done-right repo.

You can use these scripts to download the datasets: cmds. Use the script _video_ds_ytov2_2.py to reformat YTOv2.2.

Once you download the datasets, you need to adjust the paths in get_root_wsol_dataset().

Model Specific Hyperparamters and their range

Method Hyperparameter Sampling Distribution Range
Common HPs LR, WD, Gamma LogUniform [10^-5,10^0]
Common HPs Step Size Uniform CUB: [5-45], ILSVRC: [2-9]
CAM, TS-CAM, SCM, NL-CCAM Common HPs - -
HaS Drop Rate, Drop Area Uniform [0,1]
ACoL Erasing Threshold Uniform [0,1]
ADL Drop Rate, Erasing Threshold Uniform [0,1]
SAT Area Threshold Uniform [0,1]

To present the WSOL baselines with CAM over CUB using ResNet50, and for other methods by simply replacing the method name and indicating the model-specific parameter as detailed above:

cudaid=0  # cudaid=$1
export CUDA_VISIBLE_DEVICES=$cudaid
python main_wsol.py \
    --task STD_CL \
    --encoder_name resnet50 \
    --arch STDClassifier \
    --opt__name_optimizer sgd \
    --batch_size 32 \
    --max_epochs 50 \
    --freeze_cl False \
    --support_background True \
    --method CAM \
    --spatial_pooling WGAP \
    --dataset CUB \
    --box_v2_metric False \
    --cudaid 0 \
    --debug_subfolder None \
    --cam_curve_interval 0.001 \
    --exp_id with_gt_and_pseduo_metadata_id_0 \
    --num_workers 2 \
    --opt__lr 0.0001 \
    --opt__weight_decay 1e-05 \
    --opt__step_size 5 \
    --opt__gamma 0.1 \
    --metadata_roots_pseduo_boxs_valset \{\"metadata_by_clip\":\ \"folds/wsol-done-right-pseduo-splits/metadata_generated_by_clip_maps\",\ \"metadata_by_rpn\":\ \"folds/wsol-done-right-pseduo-splits/metadata_generated_by_rpn_bboxs\",\ \"metadata_by_ss\":\ \"folds/wsol-done-right-pseduo-splits/metadata_generated_by_selective_search_bboxs\"\}

About

License:GNU Lesser General Public License v2.1


Languages

Language:Python 90.9%Language:C 7.1%Language:C++ 1.7%Language:Shell 0.2%Language:SWIG 0.0%