[docs]classClassificationRawDataLoader(BaseDataLoader):"""A loader object can load samples and labels from storage for classification tasks."""def__init__(self):super().__init__()
[docs]defsample(self,sample:tuple[str,int,typing.Any|None])->Sample:"""Load whole samples from media. Parameters ---------- sample Information about the sample to load. Implementation dependent. """raiseNotImplementedError("You must implement the `sample()` method")
[docs]deftarget(self,k:typing.Any)->int|list[int]:"""Load only sample target from media. If you do not override this implementation, then, by default, this method will call :py:meth:`sample` to load the whole sample and extract the label. Parameters ---------- k The sample to load. This is implementation-dependent. Returns ------- int | list[int] The label corresponding to the specified sample. """returnself.sample(k)[1]["target"]