Skip to content

Unofficial implement of negative augmentations in "Understanding and Improving Robustness of Vision Transformers through Patch-based Negative Augmentation"

Notifications You must be signed in to change notification settings

SehuiJang/patch-based-negative-augmentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

negative-augmentation

Unofficial implement of negative augmentations in "Understanding and Improving Robustness of Vision Transformers through Patch-based Negative Augmentation"
arXiv to original paper (NeurIPS2022): link

Arguments

If you want to check whole arguments when it comes to argparse, please open 3 py files (p-shuffle.py, p-rotate.py, and p-infill.py), and see some lines starting with parser below if __name__=="__main__"

Examples of executing

P-Shuffle

python p-shuffle.py --img_path ./test_img/real_033_000211.jpg --save_dir ./runs/p-shuffle --result_name shuffle1.jpg
python p-shuffle.py --img_path ./test_img/real_033_000215.jpg --save_dir ./runs/p-shuffle --result_name shuffle2.jpg

P-Rotate

python p-rotate.py --img_path ./test_img/real_033_000211.jpg --save_dir ./runs/p-rotate --result_name rotate1.jpg
python p-rotate.py --img_path ./test_img/real_033_000215.jpg --save_dir ./runs/p-rotate --result_name rotate2.jpg

P-Infill

When replace rate is 0.25

python p-infill.py --img_path ./test_img/real_033_000211.jpg --save_dir ./runs/p-infill --replace_rate 0.25 --result_name infill1.jpg
python p-infill.py --img_path ./test_img/real_033_000215.jpg --save_dir ./runs/p-infill --replace_rate 0.25 --result_name infill2.jpg

When replace rate is 0.375

python p-infill.py --img_path ./test_img/real_033_000211.jpg --save_dir ./runs/p-infill --replace_rate 0.375 --result_name infill1.jpg
python p-infill.py --img_path ./test_img/real_033_000215.jpg --save_dir ./runs/p-infill --replace_rate 0.375 --result_name infill2.jpg

About

Unofficial implement of negative augmentations in "Understanding and Improving Robustness of Vision Transformers through Patch-based Negative Augmentation"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages