Skip to content

Commit 94bc4fe

Browse files
committed
finished instruction
1 parent de24708 commit 94bc4fe

File tree

2 files changed

+49
-28
lines changed

2 files changed

+49
-28
lines changed

README.md

Lines changed: 47 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,65 @@
11
# BLACKBOX
22

3-
main code
3+
## Installation
44

5-
## Structure
5+
```bash
6+
$ pip install vidmodex ## Stable version
7+
$ pip install git+https://github.com/hex-plex/Model-Extraction-Attacks-Video-Classification ## Latest development
8+
```
9+
10+
## Usage
11+
Simple snippet explaining the usage
12+
13+
### BlackBox Extraction
14+
```python
15+
# Black Box Victim: SwinT, Student: ViViT, Generator: Tgan
16+
17+
from vidmodex.models import ViViT as Student
18+
from vidmodex.models import SwinT as Victim
19+
from vidmodex.generator import Tgan as Generator
20+
21+
custom_config = {}
22+
custom_config["num_classes"] = 400
23+
24+
blackbox_main(custom_config)
25+
```
26+
### GreyBox Extraction
27+
28+
```python
29+
# Grey Box Victim: SwinT, Student: ViViT, Generator: Tgan, Dataset: Kinetics 400
30+
31+
from vidmodex.models import ViViT as Student
32+
from vidmodex.models import SwinT as Victim
33+
from vidmodex.generator import Tgan as Generator
34+
35+
custom_config = {}
36+
custom_config["csv_file"] = "ENTER-THE-LOCATION-OF-DATA-CSV"
37+
custom_config["root_dir"] = "ENTER-THE-LOCATION-OF-DATA-ROOT"
38+
custom_config["ucf_gan_weights"] = "ENTER-THE-LOCATION-OF-UCF-WEIGHTS" or "state_normal81000.ckpt"
39+
custom_config["num_classes"] = 400
40+
41+
greybox_main(custom_config)
42+
```
43+
44+
## File Structure
45+
46+
This is for reference if one wants to experiment his own model or algorithm he may change that specific module / part
647

748
```
849
models/
9-
- modela.py
50+
- modela.py ## Video Classification Architecture (Teacher/Student)
1051
- modelb.py
1152
train/
12-
- train_loop1.py
53+
- train_loop1.py ## Traing Algorithm
1354
- train_loop2.py
1455
generator/
15-
- generator1_.py
56+
- generator1_.py ## Video Generator Architecture
1657
- generator2_.py
1758
18-
main_1.py # usses modela with generator2 with train_loop1
59+
main_file.py ## Contains your custom config/data
1960
..
2061
```
2162

22-
## Models
23-
24-
- Setup
25-
26-
```shell
27-
#!/usr/bin/bash
28-
conda env create -f environment_swinT.yml
29-
conda activate swint
30-
mkdir weights/
31-
cd weights/
32-
#SwinT weights
33-
gdown https://drive.google.com/uc?id=10_ArqSj837hBzoQTq3RPGBZgKbBvNfSe
34-
35-
#MoviNetA2 weights
36-
gdown --id 12jpmoKb1wfF0Mpq7IeLbeoHLtJ1YaoDV
37-
38-
cd ../
39-
```
40-
41-
- Run files from root directory of this project.
42-
4363
## References
4464

4565
ViViT - https://arxiv.org/abs/2103.15691

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
author="Somnath Kumar",
1010
author_email="[email protected]",
1111
description="Code for Model Extration for Video Classification for Kinetics 400/600 trained model",
12-
# long_description=long_description,
12+
# long_description=long_description,
1313
url="https://github.com/hex-plex/vidmodex",
1414
packages=setuptools.find_packages(),
15+
install_requires=['mmaction2','timm','tqdm','torch','moviepy']
1516
)

0 commit comments

Comments
 (0)