CVBpy 14.1
TrainingSet Class Reference

Load a saved training set from a file or create an empty training set. More...

Inherits object.

Public Member Functions

List[cvb.minos.SearchResultcheck_consistency (self, float threshold, Optional[float] density=1.0)
 Test all images in the parent training set for instances of this model, that might have been forgotten during the training process. More...
 
None save (self, str file_name)
 Write the training set to a file. More...
 
cvb.minos.TrainingSet transform (self, cvb.Matrix2D transformation)
 Generate a new training set by transforming this training set with a 2 x 2 transformation matrix. More...
 

Properties

 class_count = property
 int: The number of identifiable classes inside this training set. More...
 
 comment = property
 str: Comment assigned to the training set at generation time.
 
 correlation_threshold = property
 float: The correlation value under which Minos proposes generating a new model, not generating a new instance of an existing model with which the new instance correlates poorly.
 
 expectation_radius = property
 float: The radius that is searched for the best occurrence of a sample, when adding a new sample to the training set.
 
 extent = property
 cvb.Rect: Extent of the classes in the training set relative to the anchor point.
 
 file_name = property
 str: Name of the file, from which this training set was loaded (empty string if this image list was neither loaded nor saved since its construction).
 
 is_modified = property
 bool: Flag that informs about unsaved modifications to the training set.
 
 last_feature_window = property
 cvb.Rect: Feature window of the last model that has been created for the training set.
 

Detailed Description

Load a saved training set from a file or create an empty training set.

If file_name argument is specified, the training set will be loaded from the file. If missing, empty training set will be created.

Instantiates a TrainingSet object.

Parameters

file_name : Optional[str] Name of the file to be loaded.

Member Function Documentation

◆ check_consistency()

List[cvb.minos.SearchResult] check_consistency (   self,
float  threshold,
Optional[float]   density = 1.0 
)

Test all images in the parent training set for instances of this model, that might have been forgotten during the training process.

Parameters

threshold : float Correlation threshold to be used for the consistency check.

density : Optional[float] Density to be used for the consistency check.

Returns

List[cvb.minos.SearchResult] Potentially forgotten positive samples, that may be added to the training set.

◆ save()

None save (   self,
str  file_name 
)

Write the training set to a file.

As a side effect this function sets the is_modified flag to False, if the training set was saved successfully.

Parameters

file_name : str Path to save to.

◆ transform()

cvb.minos.TrainingSet transform (   self,
cvb.Matrix2D  transformation 
)

Generate a new training set by transforming this training set with a 2 x 2 transformation matrix.

Parameters

transformation : cvb.Matrix2D Matrix with which to transform the geometry of this training set.

Returns

cvb.minos.TrainingSet Transformed training set.

Property Documentation

◆ class_count

class_count = property
static

int: The number of identifiable classes inside this training set.

The number of classes cannot be higher than the number of trained models. If two models have the same name, the classifier can no longer distinguish between these two models, reducing the class_count property.