Giter Club home page Giter Club logo

adversarial_texture's Introduction

Adversarial Texture for Fooling Person Detectors in Physical World

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:

4. Train

We provide the command to train for each method.

 python training_texture.py --method $METHOD_NAME

$METHOD_NAME can be replaced to "RCA", "TCA", EGA" or "TCEGA" when one use different methods. The patterns and checkpoints will be saved in directory "results/".

adversarial_texture's People

Contributors

whothu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.