PaintCalibrationDataset Tutorial
Note
You can find the corresponding Python script for this tutorial here:
https://github.com/ARTIST-Association/PAINT/blob/main/scripts/example_dataset.py
Since multiple calibration items may be required for training an alignment optimization or similar, we have created a
custom torch.Dataset that loads calibration items from the PAINT database.
There are three ways of creating a PaintCalibrationDataset:
Direct instantiation from local data
This approach is based on calibration data that has already been downloaded and saved in a
root_dir:dataset = PaintCalibrationDataset( root_dir=direct_root_dir, item_ids=None, item_type=args.item_type, )
The
item_idscan be a list indicating which of the items contained in theroot_dirshould be used, or ifNone, all items will be used.The
item_typespecifies what type of calibration item should be loaded (e.g., raw image, cropped image, flux image, flux-centered image, or calibration properties file).
From a benchmark file
You can also create the dataset from a benchmark file (see the :information on dataset splits:splitter for details). In this case, the
benchmark_filecontaining information on the train, validation, and test split must be provided:train, test, val = PaintCalibrationDataset.from_benchmark( benchmark_file=benchmark_file, root_dir=benchmark_root_dir, item_type=args.item_type, download=True, )
This class method returns three
torch.Datasetinstances, one for each split: train, test, and validation.From heliostat identifiers
Finally, the dataset can be created from a single heliostat or a list of heliostats. All calibration items for the provided heliostats will be used to construct the dataset:
heliostat_dataset = PaintCalibrationDataset.from_heliostats( heliostats=heliostats, root_dir=heliostat_root_dir, item_type=args.item_type, download=True, )