Skip to content
Snippets Groups Projects
Commit 7be96f4c authored by Jordi Inglada's avatar Jordi Inglada
Browse files

ENH: add option to the TrainImagesClassifier app to limit the min number of samples

parent 2e3c0515
No related branches found
No related tags found
No related merge requests found
......@@ -82,6 +82,11 @@ void TrainImagesClassifier::DoInit()
SetDefaultParameterInt("sample.mv", 1000);
SetParameterDescription("sample.mv", "Maximum size per class (in pixels) of the validation sample list (default = 1000) (no limit = -1). If equal to -1, then the maximal size of the available validation sample list per class will be equal to the surface area of the smallest class multiplied by the validation sample ratio.");
AddParameter(ParameterType_Int, "sample.bm", "Bound sample number by minimum");
SetDefaultParameterInt("sample.bm", 1);
SetParameterDescription("sample.bm", "Bound the number of samples for each class by the number of available samples by the smaller class. Proportions between training and validation are respected. Default is true (=1).");
AddParameter(ParameterType_Empty, "sample.edg", "On edge pixel inclusion");
SetParameterDescription("sample.edg",
"Takes pixels on polygon edge into consideration when building training and validation samples.");
......@@ -283,6 +288,7 @@ void TrainImagesClassifier::DoExecute()
sampleGenerator->SetMaxTrainingSize(GetParameterInt("sample.mt"));
sampleGenerator->SetMaxValidationSize(GetParameterInt("sample.mv"));
sampleGenerator->SetValidationTrainingProportion(GetParameterFloat("sample.vtr"));
sampleGenerator->SetBoundByMin(GetParameterInt("sample.bm"));
// take pixel located on polygon edge into consideration
if (IsParameterEnabled("sample.edg"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment