peal.data.custom_datasets.NicoPlusPlusDataset¶
- class peal.data.custom_datasets.NicoPlusPlusDataset[source]¶
Bases:
Image2MixedDatasetNICO++ subset in which the object category is confounded by its context.
NICO++ has to be downloaded manually to
$PEAL_DATA/NICO++.zip; if it is missing, an empty skeleton is created and aRuntimeErrorwith the download instructions is raised. Otherwise the nestedNICO_DG_Benchmark.zipis read into memory and only those images are extracted whose category is inconfig.foreground(default bear, dog) and whose context is inconfig.background(default grass, water). They are written toimgs/<category>_<context>_<counter>.jpgand listed indata.csvasimg, label, confounderwith the positions in those two lists as indices.- Parameters:
config (
DataConfig) – Usesdataset_path,foregroundandbackground.**kwargs – Forwarded to
Image2MixedDataset.
- Raises:
RuntimeError – If the zip is missing, or if it contains no matching image.
FileNotFoundError – If the nested benchmark zip cannot be found inside
NICO++.zip.
Methods
Attributes