# Adversarial_T **Repository Path**: wang_yang123/adversarial_-t ## Basic Information - **Project Name**: Adversarial_T - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-01-02 - **Last Updated**: 2024-01-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Adversarial Texture for Fooling Person Detectors in the Physical World This is the official repository for the paper [Adversarial Texture for Fooling Person Detectors in the Physical World](https://openaccess.thecvf.com/content/CVPR2022/html/Hu_Adversarial_Texture_for_Fooling_Person_Detectors_in_the_Physical_World_CVPR_2022_paper.html). #### 1. Installation ### Requirements All the codes are tested in the following environment: * Linux (Ubuntu 18.04.4) * Python 3.6 * PyTorch 1.7.1 * CUDA 11.0 * TensorboardX 2.2 * EasyDict 1.9 #### 2. Preparation You need to download the yolov2 weights by ``` wget -P ./data/models/ https://pjreddie.com/media/files/yolov2.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 ``` #### 3. Evaluation 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/" ##### RCA 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 ``` ##### TCA ``` python evaluation_texture.py --method TCA --load_path pretrained/TCA.npy --prepare_data ``` ##### EGA ``` python evaluation_texture.py --method EGA --load_path pretrained/EGA.pkl --prepare_data ``` ##### TC-EGA ``` python evaluation_texture.py --method TCEGA --load_path pretrained/EGA.pkl --load_path_z pretrained/TCEGA_z.npy --prepare_data ``` ##### Plot multiple results together 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_results ``` It will output a precision v.s. recall curve located at "test_result/PR-curve.png". An instance: