Coder Social home page Coder Social logo

masterbin-iiau / csa Goto Github PK

View Code? Open in Web Editor NEW
60.0 4.0 8.0 37.71 MB

Official implementation of CVPR2020 Paper "Cooling-Shrinking Attack"

Python 91.68% TeX 0.24% Shell 0.70% Dockerfile 0.07% MATLAB 0.42% C 5.24% Makefile 0.03% C++ 1.61%
object-tracking adversarial-attack cooling-shrinking

csa's Introduction

Cooling-Shrinking Attack (CSA)

The official implementation for CVPR2020 Paper Cooling-Shrinking Attack: Blinding the tracker with imperceptible noises

Demos

Demos for Cooling-Shrinking Attack.

Please cite our work as follows, if you find it helpful to your research. :)

@inproceedings{CSA-CVPR2020,
author = {Bin Yan and Dong Wang and Huchuan Lu and Xiaoyun Yang},
title = {{Cooling-Shrinking Attack: Blinding} the Tracker with Imperceptible Noises},
booktitle = {CVPR},
year = {2020}
}

Installation

This code has been tested on the following environment:
       NVIDIA RTX-2080Ti
       Ubuntu 16.04
       CUDA 10.0

Clone the repository

git clone https://github.com/MasterBin-IIAU/CSA.git
cd <Project_name>

Create Environment

conda create -n CSA python=3.6
source activate CSA
conda install pytorch=1.0.0 torchvision cuda100 -c pytorch
pip install -r requirements.txt
conda install pillow=6.1

Prepare the training set (optional)

  1. Download the training set of GOT-10K.
  2. Then change 'got10k_path' and 'save_path' in Unified_GOT10K_process.py to yours.
  3. Finally, run the following script.
    (it takes a long time. After running it, you can do the next steps :)
python Unified_GOT10K_process.py

Download pretrained models

  1. SiamRPN++(Model_Zoo)
    Download siamrpn_r50_l234_dwxcorr and siamrpn_r50_l234_dwxcorr_otb
    Put them under pysot/experiments/<MODEL_NAME>
  2. Perturbation Generators
    Download checkpoints you need, then put them under checkpoints/<MODEL_NAME>/
    (Google Drive, Baidu[Extraction code: 98rb])

Set some paths

Step1: Add pix2pix and pysot to environment variables

sudo gedit ~/.bashrc
# add the following two lines to the end
export PYTHONPATH=<CSA_PATH>:$PYTHONPATH
export PYTHONPATH=<CSA_PATH>/pysot:$PYTHONPATH
export PYTHONPATH=<CSA_PATH>/pix2pix:$PYTHONPATH
# close the file
source ~/.bashrc

step2: Set another paths

  1. Gather testing datasets
    create a folder outside the project folder as <DATASET_ROOT>
    then put soft links for OTB100, VOT2018 and LaSOT into it
  2. Set 'project_path_' and 'dataset_root_' Open common_path.py, go to the end
    project_path_ = <CSA_PATH>
    dataset_root_ = <DATASET_ROOT> train_set_path_ = <TRAIN_SET_PATH>

Training (Optional)

Option1: Use Default Settings
Train a generator for attacking search regions (Cooling+Shrinking)

python train1.py # See visualization in http://localhost:8097/

Train a generator for attacking search regions (Only Cooling)

python train0.py # See visualization in http://localhost:8096/

Option2: Change Settings
       If you want to train other models (like the generator for attacking the template), you can change the lines 23 and 24 in pix2pix/options/base_option0.py (or base_option1.py). In specific, modify the default values to 'G_template_L2_500' (or 'G_template_L2_500_regress'). Then run python train0.py or python train1.py
Option3: Train Your Own Models
Step1: Create a new python file under pix2pix/models.
       You can copy a file that belongs to this folder, then develop based on it. Note that the class name must match the filename.
Step2: Change default values and train (Do as instructions in Option2)

Testing

open common_path.py, choose the dataset and siamese model to use.
open GAN_utils_xx.py, choose the generator model to use.
cd pysot/tools
run experiments about attcking search regions

python run_search_adv0.py # or run_search_adv1.py

run experiments about attacking the template

python run_template_adv0.py # or run_template_adv1.py

run experiments about attacking both search regions and the template

python run_template_search_adv0.py # or run_template_search_adv1.py

csa's People

Contributors

masterbin-iiau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

csa's Issues

unknown error

我已经安装好了正确版本的cuda,但是运行代码出现了unknown error我不知道问题出在哪里,你能帮我解决吗?

I can't find the checkpoints folder.

The readme file says that we should download checkpoints you need, then put them under checkpoints/<MODEL_NAME>/. But I can't find the checkpoints folder. How to solve this problem?

import error

Hello, I follow the steps in the readme file to run the run_search_adv0.py ,but I find a error.
mmexport1615724936162.Could you help me solve this problem?

About the log files

Hi, I am very interested in your work but new to the GAN network,and could you please upload your log file for me to learn,thanks!

some questions about batch size

Hello,

If I increase batchsize in

CSA/train1.py

Line 39 in efd69a5

dataloader = DataLoader(dataset,batch_size=1,shuffle=True,num_workers=8)
, the data loader seems to have an issue.

I presume it is because the shape of full search tensor will be different for different videos and the stacking it is a problem for batch size >1. Is there any way to increase batch size with the current code for improving training speed.

The other question, can you please tell the effect of batchsize param in baseoptions1.py in the training process, I don't see its effect anywhere expect few lines in train1.py which mostly has to do with updating total iters.

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.