Collection of class information inside a classification sample list. More...
Inherits object.
Public Member Functions | |
None | add (self, str label, cvb.Image src_image, cvb.Point2D extraction_location, Optional[int] mode) |
Add a sample to a new class. More... | |
None | clear (self) |
Remove all labels (and their associated data) from the sample list. More... | |
None | has_label (self, str label) |
Check if a given label is already present in the classes collection. More... | |
None | merge_classes (self, str from_label, str to_label) |
Merge two classes into one class. More... | |
None | merge_classes_by_index (self, int from_index, int to_index) |
Merge two classes into one class. More... | |
cvb.sample_database.ImageClassificationLabelInfo | read_info (self, int index) |
Retrieves the indexed item. More... | |
List[cvb.sample_database.ImageClassificationLabelInfo] | read_infos (self) |
Retrieves all the items stored in the collection. More... | |
None | remove (self, str label) |
Remove a class and all the data objects associated with it based on its name. More... | |
None | remove_at (self, int index) |
Remove a class by index. More... | |
Properties | |
count = property | |
int: Retrieves the number of elements in the collection. | |
Collection of class information inside a classification sample list.
None add | ( | self, | |
str | label, | ||
cvb.Image | src_image, | ||
cvb.Point2D | extraction_location, | ||
Optional[int] | mode | ||
) |
Add a sample to a new class.
If the class indicated by the label already exists the sample will be added to the existing class.
label : str Name of the new class.
src_image : cvb.Image Image from which to extract the first sample for the new class.
extraction_location : cvb.Point2D Location at which to extract the first sample for the new class. Note that what the extraction location actually refers dependent on the value of the mode parameter.
mode : Optional[int] Interpretation hint for the extraction_location parameter (see cvb.sample_database.SampleExtractionMode).
None clear | ( | self | ) |
Remove all labels (and their associated data) from the sample list.
Note that this invalidates all info objects that have been taken from this collection!
None has_label | ( | self, | |
str | label | ||
) |
Check if a given label is already present in the classes collection.
label : str Label to test for.
None merge_classes | ( | self, | |
str | from_label, | ||
str | to_label | ||
) |
Merge two classes into one class.
from_label : str Class to merge to the other classes.
to_label : str Class to merge the samples to.
None merge_classes_by_index | ( | self, | |
int | from_index, | ||
int | to_index | ||
) |
Merge two classes into one class.
The class label will be taken from the 2nd class index. Note that this operation will invalidate all indices higher than from_index.
from_index : int Class to merge to the other classes.
to_index : int Class to merge the samples to.
cvb.sample_database.ImageClassificationLabelInfo read_info | ( | self, | |
int | index | ||
) |
Retrieves the indexed item.
index : int Index of the collection to be accessed.
cvb.sample_database.ImageClassificationLabelInfo Label information.
List[cvb.sample_database.ImageClassificationLabelInfo] read_infos | ( | self | ) |
Retrieves all the items stored in the collection.
List[cvb.sample_database.ImageClassificationLabelInfo] The collection items.
None remove | ( | self, | |
str | label | ||
) |
Remove a class and all the data objects associated with it based on its name.
label : str Name of the new class to be removed.
None remove_at | ( | self, | |
int | index | ||
) |
Remove a class by index.
index : int Index of the class to be removed.