Commit e459c96c authored by Ludovic Hussonnois's avatar Ludovic Hussonnois

MRG: Merge remote-tracking branch 'remotes/origin/unsupervised_classif' into develop

parents aff350aa 61c04dc3
......@@ -46,7 +46,7 @@ if(NOT OTB_USE_OPENCV)
SET(BANNED_HEADERS "${BANNED_HEADERS} otbDecisionTreeMachineLearningModelFactory.h otbDecisionTreeMachineLearningModel.h otbKNearestNeighborsMachineLearningModelFactory.h otbKNearestNeighborsMachineLearningModel.h otbRandomForestsMachineLearningModelFactory.h otbRandomForestsMachineLearningModel.h otbSVMMachineLearningModelFactory.h otbSVMMachineLearningModel.h otbGradientBoostedTreeMachineLearningModelFactory.h otbGradientBoostedTreeMachineLearningModel.h otbBoostMachineLearningModelFactory.h otbBoostMachineLearningModel.h otbNeuralNetworkMachineLearningModelFactory.h otbNeuralNetworkMachineLearningModel.h otbNormalBayesMachineLearningModelFactory.h otbNormalBayesMachineLearningModel.h otbRequiresOpenCVCheck.h otbOpenCVUtils.h otbCvRTreesWrapper.h")
endif()
if(NOT OTB_USE_SHARK)
SET(BANNED_HEADERS "${BANNED_HEADERS} otbSharkRandomForestsMachineLearningModel.h otbSharkRandomForestsMachineLearningModel.txx otbSharkUtils.h otbRequiresSharkCheck.h otbSharkRandomForestsMachineLearningModelFactory.h")
SET(BANNED_HEADERS "${BANNED_HEADERS} otbSharkRandomForestsMachineLearningModel.h otbSharkRandomForestsMachineLearningModel.txx otbSharkUtils.h otbRequiresSharkCheck.h otbSharkRandomForestsMachineLearningModelFactory.h otbSharkKMeansMachineLearningModel.h otbSharkKMeansMachineLearningModel.txx otbSharkKMeansMachineLearningModelFactory.h otbSharkKMeansMachineLearningModelFactory.txx")
endif()
if(NOT OTB_USE_LIBSVM)
SET(BANNED_HEADERS "${BANNED_HEADERS} otbLibSVMMachineLearningModel.h otbLibSVMMachineLearningModelFactory.h")
......@@ -64,7 +64,7 @@ endif()
macro( otb_module_headertest _name )
if( NOT ${_name}_THIRD_PARTY
if( NOT ${_name}_THIRD_PARTY
AND EXISTS ${${_name}_SOURCE_DIR}/include
AND PYTHON_EXECUTABLE
AND NOT (PYTHON_VERSION_STRING VERSION_LESS 2.6)
......
......@@ -70,7 +70,6 @@ otb_create_application(
SOURCES otbTrainVectorClassifier.cxx
LINK_LIBRARIES ${${otb-module}_LIBRARIES})
otb_create_application(
NAME ComputeConfusionMatrix
SOURCES otbComputeConfusionMatrix.cxx
......
......@@ -102,7 +102,22 @@ public:
typedef typename ModelType::TargetSampleType TargetSampleType;
typedef typename ModelType::TargetListSampleType TargetListSampleType;
typedef typename ModelType::TargetValueType TargetValueType;
itkGetConstReferenceMacro(SupervisedClassifier, std::vector<std::string>);
itkGetConstReferenceMacro(UnsupervisedClassifier, std::vector<std::string>);
enum ClassifierCategory{
Supervised,
Unsupervised
};
/**
* Retrieve the classifier category (supervisde or unsupervised)
* based on the select algorithm from the classifier choice.
* @return ClassifierCategory the classifier category
*/
ClassifierCategory GetClassifierCategory();
protected:
LearningApplicationBase();
......@@ -120,15 +135,23 @@ protected:
std::string modelPath);
/** Init method that creates all the parameters for machine learning models */
void DoInit();
void DoInit() ITK_OVERRIDE;
/** Flag to switch between classification and regression mode.
* False by default, child classes may change it in their constructor */
bool m_RegressionFlag;
private:
/** Specific Init and Train methods for each machine learning model */
/** Init Parameters for Supervised Classifier */
void InitSupervisedClassifierParams();
std::vector<std::string> m_SupervisedClassifier;
/** Init Parameters for Unsupervised Classifier */
void InitUnsupervisedClassifierParams();
std::vector<std::string> m_UnsupervisedClassifier;
//@{
#ifdef OTB_USE_LIBSVM
void InitLibSVMParams();
......@@ -179,6 +202,10 @@ private:
void TrainSharkRandomForests(typename ListSampleType::Pointer trainingListSample,
typename TargetListSampleType::Pointer trainingLabeledListSample,
std::string modelPath);
void InitSharkKMeansParams();
void TrainSharkKMeans(typename ListSampleType::Pointer trainingListSample,
typename TargetListSampleType::Pointer trainingLabeledListSample,
std::string modelPath);
#endif
//@}
};
......@@ -203,6 +230,7 @@ private:
#endif
#ifdef OTB_USE_SHARK
#include "otbTrainSharkRandomForests.txx"
#include "otbTrainSharkKMeans.txx"
#endif
#endif
......
......@@ -54,8 +54,33 @@ LearningApplicationBase<TInputValue,TOutputValue>
AddParameter(ParameterType_Choice, "classifier", "Classifier to use for the training");
SetParameterDescription("classifier", "Choice of the classifier to use for the training.");
InitSupervisedClassifierParams();
m_SupervisedClassifier = GetChoiceKeys("classifier");
InitUnsupervisedClassifierParams();
std::vector<std::string> allClassifier = GetChoiceKeys("classifier");
m_UnsupervisedClassifier.assign(allClassifier.begin() + m_SupervisedClassifier.size(), allClassifier.end());
}
template <class TInputValue, class TOutputValue>
typename LearningApplicationBase<TInputValue,TOutputValue>::ClassifierCategory
LearningApplicationBase<TInputValue,TOutputValue>
::GetClassifierCategory()
{
bool foundUnsupervised =
std::find(m_UnsupervisedClassifier.begin(), m_UnsupervisedClassifier.end(),
GetParameterString("classifier")) != m_UnsupervisedClassifier.end();
return foundUnsupervised ? Unsupervised : Supervised;
}
template <class TInputValue, class TOutputValue>
void
LearningApplicationBase<TInputValue,TOutputValue>
::InitSupervisedClassifierParams()
{
//Group LibSVM
#ifdef OTB_USE_LIBSVM
#ifdef OTB_USE_LIBSVM
InitLibSVMParams();
#endif
......@@ -81,7 +106,16 @@ LearningApplicationBase<TInputValue,TOutputValue>
#ifdef OTB_USE_SHARK
InitSharkRandomForestsParams();
#endif
}
template <class TInputValue, class TOutputValue>
void
LearningApplicationBase<TInputValue,TOutputValue>
::InitUnsupervisedClassifierParams()
{
#ifdef OTB_USE_SHARK
InitSharkKMeansParams();
#endif
}
template <class TInputValue, class TOutputValue>
......@@ -151,6 +185,14 @@ LearningApplicationBase<TInputValue,TOutputValue>
otbAppLogFATAL("Module SharkLearning is not installed. You should consider turning OTB_USE_SHARK on during cmake configuration.");
#endif
}
else if(modelName == "sharkkm")
{
#ifdef OTB_USE_SHARK
TrainSharkKMeans( trainingListSample, trainingLabeledListSample, modelPath );
#else
otbAppLogFATAL("Module SharkLearning is not installed. You should consider turning OTB_USE_SHARK on during cmake configuration.");
#endif
}
else if (modelName == "svm")
{
#ifdef OTB_USE_OPENCV
......
/*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef otbTrainSharkKMeans_txx
#define otbTrainSharkKMeans_txx
#include "otbLearningApplicationBase.h"
#include "otbSharkKMeansMachineLearningModel.h"
namespace otb
{
namespace Wrapper
{
template<class TInputValue, class TOutputValue>
void LearningApplicationBase<TInputValue, TOutputValue>::InitSharkKMeansParams()
{
AddChoice( "classifier.sharkkm", "Shark kmeans classifier" );
SetParameterDescription( "classifier.sharkkm",
"This group of parameters allows setting Shark kMeans classifier parameters. "
"See complete documentation here "
"\\url{http://image.diku.dk/shark/sphinx_pages/build/html/rest_sources/tutorials/algorithms/kmeans.html}.\n " );
//MaxNumberOfIterations
AddParameter( ParameterType_Int, "classifier.sharkkm.maxiter",
"Maximum number of iteration for the kmeans algorithm." );
SetParameterInt( "classifier.sharkkm.maxiter", 10 );
SetMinimumParameterIntValue( "classifier.sharkkm.maxiter", 0 );
SetParameterDescription( "classifier.sharkkm.maxiter",
"The maximum number of iteration for the kmeans algorithm. 0=unlimited" );
//MaxNumberOfIterations
AddParameter( ParameterType_Int, "classifier.sharkkm.k", "The number of class used for the kmeans algorithm." );
SetParameterInt( "classifier.sharkkm.k", 2 );
SetParameterDescription( "classifier.sharkkm.k",
"The number of class used for the kmeans algorithm. Default set to 2 class" );
SetMinimumParameterIntValue( "classifier.sharkkm.k", 2 );
}
template<class TInputValue, class TOutputValue>
void LearningApplicationBase<TInputValue, TOutputValue>::TrainSharkKMeans(
typename ListSampleType::Pointer trainingListSample,
typename TargetListSampleType::Pointer trainingLabeledListSample, std::string modelPath)
{
unsigned int nbMaxIter = static_cast<unsigned int>(abs( GetParameterInt( "classifier.sharkkm.maxiter" ) ));
unsigned int k = static_cast<unsigned int>(abs( GetParameterInt( "classifier.sharkkm.k" ) ));
typedef otb::SharkKMeansMachineLearningModel<InputValueType, OutputValueType> SharkKMeansType;
typename SharkKMeansType::Pointer classifier = SharkKMeansType::New();
classifier->SetRegressionMode( this->m_RegressionFlag );
classifier->SetInputListSample( trainingListSample );
classifier->SetTargetListSample( trainingLabeledListSample );
classifier->SetK( k );
classifier->SetMaximumNumberOfIterations( nbMaxIter );
classifier->Train();
classifier->Save( modelPath );
}
} //end namespace wrapper
} //end namespace otb
#endif
/*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef otbTrainVectorBase_h
#define otbTrainVectorBase_h
#include "otbLearningApplicationBase.h"
#include "otbWrapperApplication.h"
#include "otbWrapperApplicationFactory.h"
#include "otbOGRDataSourceWrapper.h"
#include "otbOGRFeatureWrapper.h"
#include "otbStatisticsXMLFileWriter.h"
#include "itkVariableLengthVector.h"
#include "otbStatisticsXMLFileReader.h"
#include "itkListSample.h"
#include "otbShiftScaleSampleListFilter.h"
#include <algorithm>
#include <locale>
namespace otb
{
namespace Wrapper
{
/** Utility function to negate std::isalnum */
bool IsNotAlphaNum(char c)
{
return !std::isalnum( c );
}
class TrainVectorBase : public LearningApplicationBase<float, int>
{
public:
/** Standard class typedefs. */
typedef TrainVectorBase Self;
typedef LearningApplicationBase<float, int> Superclass;
typedef itk::SmartPointer <Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Standard macro */
itkTypeMacro(Self, Superclass)
typedef Superclass::SampleType SampleType;
typedef Superclass::ListSampleType ListSampleType;
typedef Superclass::TargetListSampleType TargetListSampleType;
typedef double ValueType;
typedef itk::VariableLengthVector <ValueType> MeasurementType;
typedef otb::StatisticsXMLFileReader<SampleType> StatisticsReader;
typedef otb::Statistics::ShiftScaleSampleListFilter<ListSampleType, ListSampleType> ShiftScaleFilterType;
protected:
/** Class used to store statistics Measurment (mean/stddev) */
class ShiftScaleParameters
{
public:
MeasurementType meanMeasurementVector;
MeasurementType stddevMeasurementVector;
};
/** Class used to store a list of sample and the corresponding label */
class SamplesWithLabel
{
public:
ListSampleType::Pointer listSample;
TargetListSampleType::Pointer labeledListSample;
SamplesWithLabel()
{
listSample = ListSampleType::New();
labeledListSample = TargetListSampleType::New();
}
};
/**
* Features information class used to store informations
* about the field and class name/id of an input vector
*/
class FeaturesInfo
{
public:
/** Selected Index */
std::vector<int> m_SelectedIdx;
/** Index for class field */
std::vector<int> m_SelectedCFieldIdx;
/** Selected class field name */
std::string m_SelectedCFieldName;
/** Selected names */
std::vector <std::string> m_SelectedNames;
unsigned int m_NbFeatures;
void SetFieldNames(std::vector <std::string> fieldNames, std::vector<int> selectedIdx)
{
m_SelectedIdx = selectedIdx;
m_NbFeatures = static_cast<unsigned int>(selectedIdx.size());
m_SelectedNames = std::vector<std::string>( m_NbFeatures );
for( unsigned int i = 0; i < m_NbFeatures; ++i )
{
m_SelectedNames[i] = fieldNames[selectedIdx[i]];
}
}
void SetClassFieldNames(std::vector<std::string> cFieldNames, std::vector<int> selectedCFieldIdx)
{
m_SelectedCFieldIdx = selectedCFieldIdx;
// Handle only one class field name, if several are provided only the first one is used.
m_SelectedCFieldName = cFieldNames[selectedCFieldIdx.front()];
}
};
protected:
/**
* Function which extract and store all samples for Training and Classification.
* \param measurement statics measurement (mean/stddev)
* \param featuresInfo information about the features
*/
virtual void ExtractAllSamples(const ShiftScaleParameters &measurement);
/**
* Extract the training sample list
* \param measurement statics measurement (mean/stddev)
* \param featuresInfo information about the features
* \return sample list used for training
*/
virtual SamplesWithLabel ExtractTrainingSamplesWithLabel(const ShiftScaleParameters &measurement);
/**
* Extract classification the sample list
* \param measurement statics measurement (mean/stddev)
* \param featuresInfo information about the features
* \return sample list used for classification
*/
virtual SamplesWithLabel ExtractClassificationSamplesWithLabel(const ShiftScaleParameters &measurement);
/** Extract samples from input file for corresponding field name
*
* \param parameterName the name of the input file option in the input application parameters
* \param parameterLayer the name of the layer option in the input application parameters
* \param measurement statics measurement (mean/stddev)
* \param nbFeatures the number of features.
* \return the list of samples and their corresponding labels.
*/
SamplesWithLabel
ExtractSamplesWithLabel(std::string parameterName, std::string parameterLayer, const ShiftScaleParameters &measurement);
/**
* Retrieve statistics mean and standard deviation if input statistics are provided.
* Otherwise mean is set to 0 and standard deviation to 1 for each Features.
* \param nbFeatures
*/
ShiftScaleParameters GetStatistics(unsigned int nbFeatures);
SamplesWithLabel m_TrainingSamplesWithLabel;
SamplesWithLabel m_ClassificationSamplesWithLabel;
TargetListSampleType::Pointer m_PredictedList;
FeaturesInfo m_FeaturesInfo;
void DoInit() ITK_OVERRIDE;
void DoUpdateParameters() ITK_OVERRIDE;
void DoExecute() ITK_OVERRIDE;
};
}
}
#ifndef OTB_MANUAL_INSTANTIATION
#include "otbTrainVectorBase.txx"
#endif
#endif
......@@ -31,7 +31,9 @@ otb_module(OTBAppClassification
OTBMajorityVoting
OTBVectorDataIO
OTBSOM
OTBLearningBase
OTBSupervised
OTBUnsupervised
OTBApplicationEngine
OTBIndices
OTBMathParser
......
......@@ -37,7 +37,7 @@ namespace otb
* \ingroup Streamed
* \ingroup Threaded
*
* \ingroup OTBSupervised
* \ingroup OTBLearningBase
*/
template <class TInputImage, class TOutputImage, class TMaskImage = TOutputImage>
class ITK_EXPORT ImageClassificationFilter
......@@ -90,7 +90,7 @@ public:
itkSetMacro(BatchMode, bool);
itkGetMacro(BatchMode, bool);
itkBooleanMacro(BatchMode);
/**
* If set, only pixels within the mask will be classified.
* All pixels with a value greater than 0 in the mask, will be classified.
......
......@@ -60,10 +60,11 @@ namespace otb
* \sa NormalBayesMachineLearningModel
* \sa NeuralNetworkMachineLearningModel
* \sa SharkRandomForestsMachineLearningModel
* \sa SharkKMeansMachineLearningModel
* \sa ImageClassificationFilter
*
*
* \ingroup OTBSupervised
* \ingroup OTBLearningBase
*/
template <class TInputValue, class TTargetValue, class TConfidenceValue = double >
class ITK_EXPORT MachineLearningModel
......@@ -93,7 +94,7 @@ public:
//@}
/**\name Confidence value typedef */
typedef TConfidenceValue ConfidenceValueType;
typedef TConfidenceValue ConfidenceValueType;
typedef itk::FixedArray<ConfidenceValueType,1> ConfidenceSampleType;
typedef itk::Statistics::ListSample<ConfidenceSampleType> ConfidenceListSampleType;
......
......@@ -32,8 +32,7 @@ namespace otb
* This class intends to hold the static attributes that can not be
* part of a template class (ld error).
*
*
* \ingroup OTBSupervised
* \ingroup OTBLearningBase
*/
class OTBSupervised_EXPORT MachineLearningModelFactoryBase : public itk::Object
{
......
......@@ -21,14 +21,16 @@
#ifndef otbSharkUtils_h
#define otbSharkUtils_h
#include "otb_shark.h"
#include "itkMacro.h"
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wsign-compare"
#endif
#include <shark/Data/Dataset.h>
#include "otb_shark.h"
#include "shark/Data/Dataset.h"
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop
#endif
......
......@@ -25,6 +25,11 @@ otb_module(OTBLearningBase
DEPENDS
OTBCommon
OTBITK
OTBImageIO
OTBImageBase
OPTIONAL_DEPENDS
OTBShark
TEST_DEPENDS
OTBTestKernel
......
......@@ -243,11 +243,21 @@ KNearestNeighborsMachineLearningModel<TInputValue,TTargetValue>
//first line is the K parameter of this algorithm.
std::string line;
std::getline(ifs, line);
std::istringstream iss(line);
if( line.find( "K" ) == std::string::npos )
{
itkExceptionMacro( <<"Could not read file "<<filename );
}
std::string::size_type pos = line.find_first_of("=", 0);
std::string::size_type nextpos = line.find_first_of(" \n\r", pos+1);
this->SetK(boost::lexical_cast<int>(line.substr(pos+1, nextpos-pos-1)));
//second line is the IsRegression parameter
std::getline(ifs, line);
if( line.find( "IsRegression" ) == std::string::npos )
{
itkExceptionMacro( <<"Could not read file "<<filename );
}
pos = line.find_first_of("=", 0);
nextpos = line.find_first_of(" \n\r", pos+1);
this->SetRegressionMode(boost::lexical_cast<bool>(line.substr(pos+1, nextpos-pos-1)));
......
......@@ -43,6 +43,7 @@
#ifdef OTB_USE_SHARK
#include "otbSharkRandomForestsMachineLearningModelFactory.h"
#include "otbSharkKMeansMachineLearningModelFactory.h"
#endif
#include "itkMutexLockHolder.h"
......@@ -110,6 +111,7 @@ MachineLearningModelFactory<TInputValue,TOutputValue>
#ifdef OTB_USE_SHARK
RegisterFactory(SharkRandomForestsMachineLearningModelFactory<TInputValue,TOutputValue>::New());
RegisterFactory(SharkKMeansMachineLearningModelFactory<TInputValue,TOutputValue>::New());
#endif
#ifdef OTB_USE_OPENCV
......@@ -168,6 +170,14 @@ MachineLearningModelFactory<TInputValue,TOutputValue>
itk::ObjectFactoryBase::UnRegisterFactory(sharkRFFactory);
continue;
}
SharkKMeansMachineLearningModelFactory<TInputValue,TOutputValue> *sharkKMeansFactory =
dynamic_cast<SharkKMeansMachineLearningModelFactory<TInputValue,TOutputValue> *>(*itFac);
if (sharkKMeansFactory)
{
itk::ObjectFactoryBase::UnRegisterFactory(sharkKMeansFactory);
continue;
}
#endif
#ifdef OTB_USE_OPENCV
......
......@@ -21,8 +21,6 @@
#ifndef otbSharkRandomForestsMachineLearningModel_h
#define otbSharkRandomForestsMachineLearningModel_h
#include "otb_shark.h"
#include "itkLightObject.h"
#include "otbMachineLearningModel.h"
......@@ -36,6 +34,7 @@
#pragma GCC diagnostic ignored "-Wcast-align"
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
#endif
#include "otb_shark.h"
#include "shark/Algorithms/Trainers/RFTrainer.h"
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop
......
......@@ -198,6 +198,8 @@ SharkRandomForestsMachineLearningModel<TInputValue,TOutputValue>
{
itkExceptionMacro(<< "Error opening " << filename.c_str() );
}
// Add comment with model file name
ofs << "#" << m_RFModel.name() << std::endl;
shark::TextOutArchive oa(ofs);
m_RFModel.save(oa,0);
}
......@@ -208,8 +210,25 @@ SharkRandomForestsMachineLearningModel<TInputValue,TOutputValue>
::Load(const std::string & filename, const std::string & itkNotUsed(name))
{
std::ifstream ifs(filename.c_str());
shark::TextInArchive ia(ifs);
m_RFModel.load(ia,0);
if( ifs.good() )
{
// Check if the first line is a comment and verify the name of the model in this case.
std::string line;
getline( ifs, line );
if( line.at( 0 ) == '#' )
{
if( line.find( m_RFModel.name() ) == std::string::npos )
itkExceptionMacro( "The model file : " + filename + " cannot be read." );
}
else
{
// rewind if first line is not a comment
ifs.clear();
ifs.seekg( 0, std::ios::beg );
}
shark::TextInArchive ia( ifs );
m_RFModel.load( ia, 0 );
}
}
template <class TInputValue, class TOutputValue>
......
......@@ -29,12 +29,14 @@ ENABLE_SHARED
OTBCommon
OTBITK
OTBImageBase
OTBLearningBase
OTBUnsupervised
OPTIONAL_DEPENDS
OTBOpenCV
OTBSVMLearning
OTBShark
TEST_DEPENDS
OTBTestKernel
OTBImageIO
......
......@@ -322,4 +322,5 @@ int otbSharkRFMachineLearningModelCanRead(int argc, char* argv[])
return EXIT_SUCCESS;
}
#endif
......@@ -92,7 +92,7 @@ void RegisterTests()
REGISTER_TEST(otbSharkRFMachineLearningModelCanRead);
REGISTER_TEST(otbSharkImageClassificationFilter);
#endif
REGISTER_TEST(otbImageClassificationFilterNew);
REGISTER_TEST(otbImageClassificationFilter);
}
......@@ -1290,4 +1290,5 @@ int otbSharkRFMachineLearningModel(int argc, char * argv[])
return EXIT_SUCCESS;
}
#endif
......@@ -34,17 +34,17 @@ otb_add_test(NAME leTvSharkRFMachineLearningModelCanRead COMMAND otbSupervisedTe
otb_add_test(NAME leTvSharkRFMachineLearningModelCanReadFail COMMAND otbSupervisedTestDriver
otbSharkRFMachineLearningModelCanRead
${INPUTDATA}/ROI_QB_MUL_4_svmModel.txt
${INPUTDATA}/Classification/otbSharkImageClassificationFilter_KMeansmodel.txt
)
set_property(TEST leTvSharkRFMachineLearningModelCanReadFail PROPERTY WILL_FAIL true)
otb_add_test(NAME leTvImageClassificationFilterSharkFast COMMAND otbSupervisedTestDriver
--compare-n-images ${NOTOL} 2