README.md 3.51 KB
Newer Older
tl2120's avatar
tl2120 committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# Attack and Defences on LiDAR-based Perception Documentation
#### Release 0.0.1
###### 02 September 2021

<div style="page-break-after: always;"></div>

*Attack and Defences Repository* explores different LiDAR-based perception module, namely PIXOR, PointRCNN and PointPillar - in the form of Baidu Apollo v6.0

<div style="page-break-after: always;"></div>

# Table of Contents
* PIXOR
    *  Dependencies
    *  File Structure
    *  Getting Started
    *  Download Kitti Dataset
    *  Run PIXOR Perception Module
    *  View Results
* PointRCNN
    * Dependencies
* Baidu Apollo
    * Docker load


<div style="page-break-after: always;"></div>

# PIXOR
##### Dependencies: 
- Python 3.5(3.6)
- Pytorch (Follow Official Installation Guideline)
- Tensorflow (see their website)
- Numpy, MatplotLib, OpenCV3
- PyKitti (for running on KITTI raw dataset)
- gcc

Note: All requirements are preloaded into pixorenv

#### File Structure
```
attack_and_defences...
├── PIXOR
│   ├──  Kitti_Dataset
|   |   ├──  raw_data_downloader.sh
|   |   ├── 2011_09_26
|   |   ...
|   ├──  PIXOR
|   |   ├── srcs
|   |   ... ├── run_kitti.py
|   ├──  pixorenv
│   │   ├──  bin
|   |   |   ├──  activate
|   |   |   ....
```


##### Getting Started
    Ensure that virtualenv is installed
    $ pip install virtualenv
>
    Activate PIXOR virtual environment
    $ cd PIXOR
    $ source pixorenv/bin/activate

##### Download Kitti Dataset
    $ cd Kitti_Dataset
    $ ./raw_data_downloader.sh

##### Run PIXOR Perception Module
    $ cd PIXOR
    $ cd srcs
    $ python run_kitti.py
    
##### View Results
Depending on the video that was processed, typically located in PIXOR/Kitti_Dataset/2011_09_26/ ...

<div style="page-break-after: always;"></div>

# PointRCNN
##### Dependencies: 
All the codes are tested in the following environment:
* Linux (tested on Ubuntu 14.04/16.04)
* Python 3.6+
* PyTorch 1.0

Note: All requirements are preloaded into conda environment

#### File Structure
```
attack_and_defences...
├── PointRCNN
│   ├──  conda
|   |   ├──  bin
|   |   |    ├── activate
|   |   ...
|   ├──  PointRCNN 
|   |   ├── tools
|   |   ... ├── eval_rcnn.py
|   |   ├──  PointRCNN.pth
|   |   ├──  output
```

##### Getting Started
    Ensure that Anaconda or Miniconda is installed

    Activate conda virtual environment
    $ cd PointRCNN
    $ ./conda/bin/activate
    
##### Run PIXOR Perception Module
    $ cd PointRCNN
    $ cd tools
    $ python eval_rcnn.py --cfg_file cfgs/default.yaml --ckpt <Path_To_PointRCNN.pth> --batch_size 1 --eval_mode rcnn --set RPN.LOC_XZ_FINE False

    
##### View Results
Depending on the video that was processed, typically located in PointRCNN/output/ ...

# Apollo Baidu Docker Image
*Requires Docker* 

#### File Structure
```
attack_and_defences...
├── apollo
│   ├──  modules
|   |   ├──  pcpc
|   |   |    ├── BUILD
|   |   |    ├── talker.cc
|   |   |    ├── adv_loss.py
|   |   |    ├── logs
|   |   |    |  ├── cls_score.txt
|   |   |    |  ├── bbox_pred.txt
|   |   ...
|   ├──  bazel-bin
|   |   ├── modules
|   |   ... ├── pcpc
|   |   |   |    ├──  talker
|   |   ├──  output
```

##### Run build
    From root directory /apollo
    $ ./apollo.sh build pcpc

##### Run talker
*To update cls_score.txt and bbox_pred.txt*
    $ ./bazel-bin/modules/pcpc/talker
    $ cd tools
    
#### Run adv_loss.py
    $ python modules/pcpc/adv_loss.py