Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
fakebit 366b86cf30 | 1 year ago | |
---|---|---|
data | 2 years ago | |
docs | 2 years ago | |
pretrained | 2 years ago | |
test_results | 2 years ago | |
yolo2 | 2 years ago | |
yolo3 | 2 years ago | |
.DS_Store | 2 years ago | |
LICENSE | 2 years ago | |
README.md | 2 years ago | |
__init__.py | 2 years ago | |
cfg.py | 2 years ago | |
evaluation_texture.py | 1 year ago | |
generator_dim.py | 2 years ago | |
generator_dim2.py | 2 years ago | |
load_models.py | 2 years ago | |
median_pool.py | 2 years ago | |
models_ensemble.py | 2 years ago | |
tps_grid_gen.py | 2 years ago | |
training_texture.py | 2 years ago | |
utils.py | 2 years ago |
Official implementation for the CVPR 2022 paper Adversarial Texture for Fooling Person Detectors in Physical World
by Zhanhao Hu, Siyuan Huang, Xiaopei Zhu, Xiaolin Hu, Fuchun Sun, Bo Zhang.
Note: The code is based on the official implementation for the paper Fooling Automated Surveillance Cameras: Adversarial Patches to Attack Person Detection.
All the codes are tested in the following environment:
You need to download the yolov2 and yolov3 weights by
wget -P ./data/models/ https://pjreddie.com/media/files/yolov2.weights
wget -P ./data/models/ https://pjreddie.com/media/files/yolov3.weights
and prepare the Inria Dataset
curl ftp://ftp.inrialpes.fr/pub/lear/douze/data/INRIAPerson.tar -o inria.tar
tar xf inria.tar
mv INRIAPerson ./data
We provide the pre-trained parameters of 4 methods for implementing Adversarial Textures (AdvTexture) to attack YOLOv2. Use the following commands to output average precision (AP) for single run. Each command will additionally output a numpy data file and a png format image which are stored in directory "test_results/"
When the side length of the cloth is two times that of the patch
python evaluation_texture.py --method RCA --load_path pretrained/RCA2.npy --suffix yolov2_RCA2 --prepare_data
When the side length of the cloth is six times that of the patch
python evaluation_texture.py --method RCA --load_path pretrained/RCA6.npy --suffix yolov2_RCA6 --prepare_data
python evaluation_texture.py --method TCA --load_path pretrained/TCA.npy --prepare_data
python evaluation_texture.py --method EGA --load_path pretrained/EGA.pkl --prepare_data
python evaluation_texture.py --method TCEGA --load_path pretrained/EGA.pkl --load_path_z pretrained/TCEGA_z.npy --prepare_data
In addition, we provide a command to plot all the results together. For example, if one run all five evaluations above, then run:
python evaluation_texture.py --npz_dir ./test_result
It will output a precision v.s. recall curve located at "test_result/PR-curve.png".
We provide the command to train for each method.
python training_texture.py --net $NET_NAME --method $METHOD_NAME
One need to replace $NET_NAME to "yolov2" or "yolov3" to target different detectors. The $METHOD_NAME can be replaced to "RCA", "TCA", EGA" or "TCEGA" to use different methods. For example, one can use TC-EGA to attack YOLOv2 by
python training_texture.py --net yolov2 --method TCEGA
The patterns and checkpoints will be saved in directory "results/".
No Description
Pickle Python Text
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》