TNauen commited on
Commit
d158a8c
·
verified ·
1 Parent(s): bc1256b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +104 -30
README.md CHANGED
@@ -7,41 +7,115 @@ size_categories:
7
  - 1M<n<10M
8
  ---
9
 
 
 
 
10
  # ForAug/ForNet
 
11
 
12
  This is the ForNet dataset from the paper [ForAug: Recombining Foregrounds and Backgrounds to Improve Vision Transformer Training with Bias Mitigation](https://www.arxiv.org/abs/2503.09399).
13
 
14
- ## Dataset Details
15
-
16
- ### Dataset Description
17
-
18
- <!-- Provide a longer summary of what this dataset is. -->
19
-
20
-
21
-
22
- - **Curated by:** [Tobias Christian Nauen](https://tobias.nauen-it.de)
23
-
24
- ### Dataset Sources [optional]
25
-
26
- <!-- Provide the basic links for the dataset. -->
27
-
28
- - **Repository:** [GitHub](https://github.com/tobna/ForAug)
29
- - **Paper:** [arXiv](https://www.arxiv.org/abs/2503.09399)
30
-
31
- ## Usage
32
- Coming Soon
33
-
34
-
35
- ## Dataset Structure
36
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  Coming Soon
38
 
39
- ## Dataset Creation
40
-
41
- Coming Soon
42
- ## Citation [optional]
43
 
44
- Coming Soon
45
- **BibTeX:**
46
 
47
- [More Information Needed]
 
 
 
7
  - 1M<n<10M
8
  ---
9
 
10
+ [![arXiv](https://img.shields.io/badge/arXiv-2503.09399-b31b1b?logo=arxiv)](https://arxiv.org/abs/2503.09399)
11
+ [![Static Badge](https://img.shields.io/badge/GitHub-Repo-blue?logo=github)](https://github.com/tobna/ForAug)
12
+
13
  # ForAug/ForNet
14
+ ![ForAug](images/foraug.png)
15
 
16
  This is the ForNet dataset from the paper [ForAug: Recombining Foregrounds and Backgrounds to Improve Vision Transformer Training with Bias Mitigation](https://www.arxiv.org/abs/2503.09399).
17
 
18
+ ### Updates
19
+
20
+ - [19.03.2025] We release the code to download and use [ForNet on GitHub](https://github.com/tobna/ForAug) :computer:
21
+ - [19.03.2025] We release the patch files of ForNet on Huggingface :hugs:
22
+ - [12.03.2025] We release the preprint of [ForAug on arXiv](https://www.arxiv.org/abs/2503.09399) :spiral_notepad:
23
+
24
+
25
+ ## Using ForAug/ForNet
26
+
27
+ ### Preliminaries
28
+ To be able to download ForNet, you will need the ImageNet dataset in the usual format at `<in_path>`:
29
+ ```
30
+ <in_path>
31
+ |--- train
32
+ | |--- n01440764
33
+ | | |--- n01440764_10026.JPEG
34
+ | | |--- n01440764_10027.JPEG
35
+ | | |--- n01440764_10029.JPEG
36
+ | | `- ...
37
+ | |--- n01693334
38
+ | `- ...
39
+ `-- val
40
+ |--- n01440764
41
+ | |--- ILSVRC2012_val_00000293.JPEG
42
+ | |--- ILSVRC2012_val_00002138.JPEG
43
+ | |--- ILSVRC2012_val_00003014.JPEG
44
+ | `- ...
45
+ |--- n01693334
46
+ `- ...
47
+ ```
48
+
49
+ ### Downloading ForNet
50
+ To download and prepare the already-segmented ForNet dataset at `<data_path>`, follow these steps:
51
+ #### 1. Clone the git repository and install the requirements
52
+ ```
53
+ git clone https://github.com/tobna/ForAug
54
+ cd ForAug
55
+ pip install -r prep-requirements.txt
56
+ ```
57
+
58
+ #### 2. Download the diff files
59
+ ```
60
+ ./download_diff_files.sh <data_path>
61
+ ```
62
+ This script will download all dataset files to `<data_path>`
63
+
64
+ #### 3. Apply the diffs to ImageNet
65
+ ```
66
+ python apply_patch.py -p <data_path> -in <in_path> -o <data_path>
67
+ ```
68
+ This will apply the diffs to ImageNet and store the results in the `<data_path>` folder. It will also delete the already-processes patch files (the ones downloaded in step 2). In order to keep the patch files, add the `--keep` flag.
69
+
70
+ #### Optional: Zip the files without compression
71
+ When dealing with a large cluster and dataset files that have to be sent over the network (i.e. the dataset is on another server than the one used for processing) it's sometimes useful to not deal with many small files and have fewer large ones instead.
72
+ If you want this, you can zip up the files (without compression) by using
73
+ ```
74
+ ./zip_up.sh <data_path>
75
+ ```
76
+
77
+ ### Creating ForNet from Scratch
78
+ Coming soon
79
+
80
+ ### Using ForNet
81
+ To use ForAug/ForNet you need to have it available in folder or zip form (see [Downloading ForNet](#downloading-fornet)) at `data_path`.
82
+ Additionally, you need to install the (standard) requirements from 'requirements.txt':
83
+ ```
84
+ pip install -r requirements.txt
85
+ ```
86
+
87
+ Then, just do
88
+ ```python
89
+ from fornet import ForNet
90
+
91
+ data_path = ...
92
+
93
+ dataset = ForNet(
94
+ data_path,
95
+ train=True,
96
+ transform=None,
97
+ background_combination="all",
98
+ )
99
+
100
+ ```
101
+
102
+ For information on all possible parameters, run
103
+ ```python
104
+ from fornet import ForNet
105
+
106
+ help(ForNet.__init__)
107
+ ```
108
+
109
+ ## Citation
110
  Coming Soon
111
 
112
+ ### Dataset Sources
113
+ - **Repository:**: [GitHub](https://github.com/tobna/ForAug)
114
+ - **Paper:**: [arXiv](https://www.arxiv.org/abs/2503.09399)
115
+ - **Project Page**: coming soon
116
 
117
+ ## ToDos
 
118
 
119
+ - [x] release code to download and create ForNet
120
+ - [x] release code to use ForNet for training and evaluation
121
+ - [ ] integrate ForNet into Huggingface Datasets