Skip to content
Snippets Groups Projects
Commit 0edb97dd authored by Julien Malik's avatar Julien Malik
Browse files

BUG: fix getter for number of classes and class min size

parent c0aa9bd3
No related branches found
No related tags found
No related merge requests found
...@@ -169,8 +169,10 @@ private: ...@@ -169,8 +169,10 @@ private:
bool m_PolygonEdgeInclusion; // if true take into consideration pixel which are on polygon edge bool m_PolygonEdgeInclusion; // if true take into consideration pixel which are on polygon edge
// useful, when dealing with small polygon area (1 or two pixels) // useful, when dealing with small polygon area (1 or two pixels)
// false by default // false by default
unsigned short m_NumberOfClasses;
std::string m_ClassKey; std::string m_ClassKey;
double m_ClassMinSize;
ListSamplePointerType m_TrainingListSample; ListSamplePointerType m_TrainingListSample;
ListLabelPointerType m_TrainingListLabel; ListLabelPointerType m_TrainingListLabel;
ListSamplePointerType m_ValidationListSample; ListSamplePointerType m_ValidationListSample;
......
...@@ -65,7 +65,9 @@ ListSampleGenerator<TImage, TVectorData> ...@@ -65,7 +65,9 @@ ListSampleGenerator<TImage, TVectorData>
m_MaxValidationSize(-1), m_MaxValidationSize(-1),
m_ValidationTrainingProportion(0.0), m_ValidationTrainingProportion(0.0),
m_PolygonEdgeInclusion(false), m_PolygonEdgeInclusion(false),
m_ClassKey("Class") m_NumberOfClasses(0),
m_ClassKey("Class"),
m_ClassMinSize(-1)
{ {
this->SetNumberOfRequiredInputs(2); this->SetNumberOfRequiredInputs(2);
this->SetNumberOfRequiredOutputs(1); this->SetNumberOfRequiredOutputs(1);
...@@ -232,12 +234,10 @@ ListSampleGenerator<TImage, TVectorData> ...@@ -232,12 +234,10 @@ ListSampleGenerator<TImage, TVectorData>
} }
} }
} }
} }
assert(m_TrainingListSample->Size() == m_TrainingListLabel->Size()); assert(m_TrainingListSample->Size() == m_TrainingListLabel->Size());
assert(m_ValidationListSample->Size() == m_ValidationListLabel->Size()); assert(m_ValidationListSample->Size() == m_ValidationListLabel->Size());
} }
template <class TImage, class TVectorData> template <class TImage, class TVectorData>
...@@ -261,7 +261,7 @@ ListSampleGenerator<TImage, TVectorData> ...@@ -261,7 +261,7 @@ ListSampleGenerator<TImage, TVectorData>
m_ClassesSize[datanode->GetFieldAsInt(m_ClassKey)] += area; m_ClassesSize[datanode->GetFieldAsInt(m_ClassKey)] += area;
} }
} }
m_NumberOfClasses = m_ClassesSize.size();
} }
template <class TImage, class TVectorData> template <class TImage, class TVectorData>
......
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