CVBpy 14.0
ImageClassificationInfoCollection Class Reference

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.ImageClassificationLabelInforead_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.
 

Detailed Description

Collection of class information inside a classification sample list.

Member Function Documentation

◆ add()

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.

Parameters

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).

◆ clear()

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!

◆ has_label()

None has_label (   self,
str  label 
)

Check if a given label is already present in the classes collection.

Parameters

label : str Label to test for.

◆ merge_classes()

None merge_classes (   self,
str  from_label,
str  to_label 
)

Merge two classes into one class.

Parameters

from_label : str Class to merge to the other classes.

to_label : str Class to merge the samples to.

◆ merge_classes_by_index()

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.

Parameters

from_index : int Class to merge to the other classes.

to_index : int Class to merge the samples to.

◆ read_info()

cvb.sample_database.ImageClassificationLabelInfo read_info (   self,
int  index 
)

Retrieves the indexed item.

Parameters

index : int Index of the collection to be accessed.

Returns

cvb.sample_database.ImageClassificationLabelInfo Label information.

◆ read_infos()

Retrieves all the items stored in the collection.

Returns

List[cvb.sample_database.ImageClassificationLabelInfo] The collection items.

◆ remove()

None remove (   self,
str  label 
)

Remove a class and all the data objects associated with it based on its name.

Parameters

label : str Name of the new class to be removed.

◆ remove_at()

None remove_at (   self,
int  index 
)

Remove a class by index.

Parameters

index : int Index of the class to be removed.