Dataset
DummyFacePairsDataset
Bases: FacePairsDataset
Dummy in-memory dataset for testing
Source code in src/dataset/dummy.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | |
FacePairsDataset
Bases: Dataset, Sized, ABC
Interface for use with Face Pairs Benchmark
Source code in src/dataset/face_pairs.py
7 8 9 10 11 12 13 14 | |
LFWDataset
Bases: FacePairsDataset
Torch Dataset for Labeled Faces in the Wild (LFW)
https://www.kaggle.com/datasets/jessicali9530/lfw-dataset
Source code in src/dataset/lfw.py
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 | |
make_file_path(name, img_num)
staticmethod
Relative to root dir
Source code in src/dataset/lfw.py
22 23 24 25 | |
ROFDataset
Bases: FacePairsDataset
Torch dataset class for the Real World Occluded Faces dataset
https://github.com/ekremerakin/RealWorldOccludedFaces
Source code in src/dataset/rof.py
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 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | |
__getitem__(idx)
Returns a pair of images and their label (neutral image, occluded image, label).
Source code in src/dataset/rof.py
166 167 168 169 170 171 172 173 174 175 176 | |
dummy
DummyFacePairsDataset
Bases: FacePairsDataset
Dummy in-memory dataset for testing
Source code in src/dataset/dummy.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | |
face_pairs
FacePairsDataset
Bases: Dataset, Sized, ABC
Interface for use with Face Pairs Benchmark
Source code in src/dataset/face_pairs.py
7 8 9 10 11 12 13 14 | |
lfw
LFWDataset
Bases: FacePairsDataset
Torch Dataset for Labeled Faces in the Wild (LFW)
https://www.kaggle.com/datasets/jessicali9530/lfw-dataset
Source code in src/dataset/lfw.py
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 | |
make_file_path(name, img_num)
staticmethod
Relative to root dir
Source code in src/dataset/lfw.py
22 23 24 25 | |
rococo
RococoDataset
dataclass
Representation of the Rococo dataset
Only stores filenames and information on the directory structure, does not interact with the filesystem
The dataset is structured as follows:
<root_dir>
├── <faces_dir>
│ ├── frame_1_face_1.jpg
│ ├── frame_1_face_2.jpg
│ └── ...
└── <frames_dir>
├── frame_1_face_1_frame_2.jpg
├── frame_1_face_2_frame_3.jpg
└── ...
Elements are pairs of (face, frame sequence), only those with at least 3 frames (not all faces). All faces are needed for search and comparison in the validation procedure.
Face files are matched with corresponding frame files based on filename prefix.
The filenames are misleading - face is identified by frame_X_face_Y,
frames corresponding to the same face are identified by frame_X_face_Y_frame_Z and differ only by Z.
Also supports a dataset with multiple sequences of frames for the same face.
The filenames of frames are in the format frame_X_face_Y_sequence_Z_frame_W.
If there are multiple sequences, there will be multiple elements with the same face (one element for each sequence).
Source code in src/dataset/rococo.py
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 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 | |
face_index(face)
Return the position of given face in all_faces
Source code in src/dataset/rococo.py
209 210 211 | |
from_directory_with_multiple_sequences(root_dir, faces_dir='faces', frames_dir='frames')
classmethod
Create a RococoDataset with multiple sequences of frames for the same face.
For loading Rococo-synth dataset
The filenames of frames are in the format frame_X_face_Y_sequence_Z_frame_W.
There will be multiple elements with the same face (one element for each sequence).
Source code in src/dataset/rococo.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | |
get_all_faces(faces_dict, elements)
staticmethod
Return a list of faces for searching matches
All faces present in the faces directory
Source code in src/dataset/rococo.py
281 282 283 284 285 286 287 288 289 | |
get_face_to_sequences_mapping(faces, frames)
staticmethod
Return a mapping of face filenames to sequences of frames
Source code in src/dataset/rococo.py
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 | |
RococoSmallDataset
dataclass
Bases: RococoDataset
Rococo dataset with a narrowed set of all_faces
The set of all_faces (for searching matches) is narrowed to only those, for which a sequence of frames is present in the dataset.
len(all_faces) == len(elements)
Source code in src/dataset/rococo.py
292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 | |
get_all_faces(faces_dict, elements)
staticmethod
Return a list of faces for searching matches
Only those faces are returned, for which a sequence of frames is present in the dataset.
Source code in src/dataset/rococo.py
301 302 303 304 305 306 307 308 309 310 | |
rof
ROFDataset
Bases: FacePairsDataset
Torch dataset class for the Real World Occluded Faces dataset
https://github.com/ekremerakin/RealWorldOccludedFaces
Source code in src/dataset/rof.py
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 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | |
__getitem__(idx)
Returns a pair of images and their label (neutral image, occluded image, label).
Source code in src/dataset/rof.py
166 167 168 169 170 171 172 173 174 175 176 | |
RofItem
dataclass
Represents a single item in the ROFDataset
Label is 1 for matched pairs (neutral and occluded of the same person), -1 for mismatched pairs (neutral and occluded of different people).
File paths relative to the root directory.
Source code in src/dataset/rof.py
52 53 54 55 56 57 58 59 60 61 62 63 64 | |
RofVariant
Bases: Enum
Source code in src/dataset/rof.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | |
identity_suffix()
Returns the suffix for the identity name in the dataset.
Source code in src/dataset/rof.py
17 18 19 20 21 22 23 24 25 | |
subdirectory()
Returns the subdirectory name for the variant.
Source code in src/dataset/rof.py
27 28 29 30 31 32 33 34 35 | |