Skip to content

clsdatainfo

clsdatainfo

Module for ClsDataInfo

Classes

ClsData dataclass

Contains all data for classification

Functions
get_identifier
get_identifier()

Return the identifier

Source code in niceml/data/datainfos/clsdatainfo.py
def get_identifier(self) -> str:
    """Return the identifier"""
    return self.identifier
get_index_list
get_index_list()

Return a list of class indexes

Source code in niceml/data/datainfos/clsdatainfo.py
def get_index_list(self) -> List[int]:
    """Return a list of class indexes"""
    return [self.class_idx] if isinstance(self.class_idx, int) else self.class_idx
get_index_of_name
get_index_of_name(name)

Return the index of the class with the given name

Source code in niceml/data/datainfos/clsdatainfo.py
def get_index_of_name(self, name: str) -> int:
    """Return the index of the class with the given name"""
    return self.get_name_list().index(name)
get_name_list
get_name_list()

Return a list of class names

Source code in niceml/data/datainfos/clsdatainfo.py
def get_name_list(self) -> List[str]:
    """Return a list of class names"""
    return (
        [self.class_name] if isinstance(self.class_name, str) else self.class_name
    )

ClsDataInfo dataclass

Bases: ImageDataInfo

Contains all information about one data point for classification

Functions
get_image_filepath
get_image_filepath()

Return the image filepath

Source code in niceml/data/datainfos/clsdatainfo.py
def get_image_filepath(self) -> str:
    """Return the image filepath"""
    return get_location_uri(self.image_location)
get_image_location
get_image_location()

Return the image filepath

Source code in niceml/data/datainfos/clsdatainfo.py
def get_image_location(self) -> Union[dict, LocationConfig]:
    """Return the image filepath"""
    return self.image_location
get_index_list
get_index_list()

Return a list of class indexes

Source code in niceml/data/datainfos/clsdatainfo.py
def get_index_list(self) -> List[int]:
    """Return a list of class indexes"""
    return [self.class_idx] if isinstance(self.class_idx, int) else self.class_idx
get_index_of_name
get_index_of_name(name)

Return the index of the class with the given name

Source code in niceml/data/datainfos/clsdatainfo.py
def get_index_of_name(self, name: str) -> int:
    """Return the index of the class with the given name"""
    return self.get_name_list().index(name)
get_name_list
get_name_list()

Return a list of class names

Source code in niceml/data/datainfos/clsdatainfo.py
def get_name_list(self) -> List[str]:
    """Return a list of class names"""
    return (
        [self.class_name] if isinstance(self.class_name, str) else self.class_name
    )

Functions