element
DatasetElement
An element of the dataset.
Attributes:
Name | Type | Description |
---|---|---|
x |
tuple[ElementImage, ...]
|
The image(s) of the dataset element. |
y |
ElementClass
|
The class of the dataset element. |
original_dataset |
str
|
The name of the original dataset from which the element was taken. It is equal to the dataset name specified in the configuration file. |
dataset_root_path |
Path
|
The path to the root directory of the dataset. |
Source code in revelio/dataset/element.py
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 |
|
__init__(x: tuple[ElementImage, ...], y: ElementClass, *, dataset_root_path: Path, original_dataset: str) -> None
Creates a new dataset element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
tuple[ElementImage, ...]
|
The image(s) of the dataset element. |
required |
y |
ElementClass
|
The class of the dataset element. |
required |
dataset_root_path |
Path
|
The path to the root directory of the dataset. |
required |
original_dataset |
str
|
The name of the original dataset from which the element was taken. |
required |
Source code in revelio/dataset/element.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 |
|
dataset_root_path() -> Path
property
Gets the path to the root directory of the dataset.
Source code in revelio/dataset/element.py
193 194 195 196 197 198 |
|
original_dataset() -> str
property
Gets the name of the original dataset from which the element was taken.
Source code in revelio/dataset/element.py
200 201 202 203 204 205 |
|
x() -> tuple[ElementImage, ...]
property
Gets the image(s) of the dataset element.
Source code in revelio/dataset/element.py
207 208 209 210 211 212 |
|
y() -> ElementClass
property
Gets the class of the dataset element.
Source code in revelio/dataset/element.py
214 215 216 217 218 219 |
|
DatasetElementDescriptor
A descriptor of a dataset element before it is loaded into memory.
Attributes:
Name | Type | Description |
---|---|---|
x |
tuple[Path, ...]
|
The path to the image file(s). |
y |
ElementClass
|
The class of the dataset element. |
Source code in revelio/dataset/element.py
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 |
|
__init__(x: tuple[Path, ...], y: ElementClass) -> None
Creates a new dataset element descriptor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
tuple[Path, ...]
|
The path to the image file(s). |
required |
y |
ElementClass
|
The class of the dataset element. |
required |
Source code in revelio/dataset/element.py
35 36 37 38 39 40 41 42 43 44 |
|
x() -> tuple[Path, ...]
property
Gets the path to the image file(s).
Source code in revelio/dataset/element.py
46 47 48 49 50 51 |
|
y() -> ElementClass
property
Gets the class of the dataset element.
Source code in revelio/dataset/element.py
53 54 55 56 57 58 |
|
ElementClass
Bases: Enum
The class of a dataset element, which can be either bona fide or morphed.
Source code in revelio/dataset/element.py
12 13 14 15 16 17 18 |
|
ElementImage
An image that is part of a dataset element.
An image is represented with a Numpy array with shape (height, width, channels) and dtype uint8 or float32. The channels are ordered as BGR, following the OpenCV convention.
Attributes:
Name | Type | Description |
---|---|---|
path |
Path
|
The path to the image file. |
image |
Image
|
The image. |
landmarks |
Optional[Landmarks]
|
The facial landmarks of the image (if present). |
features |
dict[str, np.ndarray]
|
The features of the image produced by each feature extractor (if present). |
Source code in revelio/dataset/element.py
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 |
|
__init__(path: Path, image: Image, landmarks: Optional[Landmarks] = None, features: Optional[dict[str, np.ndarray]] = None) -> None
Creates a new image of a dataset element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
Path
|
The path to the image file. |
required |
image |
Image
|
The image. |
required |
landmarks |
Optional[Landmarks]
|
The facial landmarks of the image (if present). |
None
|
features |
Optional[dict[str, np.ndarray]]
|
The features of the image produced by each feature extractor (if present). |
None
|
Source code in revelio/dataset/element.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
|
features() -> dict[str, np.ndarray]
property
Gets the features of the image produced by each feature extractor (if present).
Source code in revelio/dataset/element.py
141 142 143 144 145 146 |
|
image() -> Image
property
Gets the image.
Source code in revelio/dataset/element.py
127 128 129 130 131 132 |
|
landmarks() -> Optional[Landmarks]
property
Gets the facial landmarks of the image (if present).
Source code in revelio/dataset/element.py
134 135 136 137 138 139 |
|
path() -> Path
property
Gets the path to the image file.
Source code in revelio/dataset/element.py
120 121 122 123 124 125 |
|