...
  View open merge request
Commits (39)
......@@ -125,5 +125,10 @@ otb_create_application(
SOURCES otbZonalStatistics.cxx
LINK_LIBRARIES ${${otb-module}_LIBRARIES})
otb_create_application(
NAME TrainImagesRegression
SOURCES otbTrainImagesRegression.cxx
LINK_LIBRARIES ${${otb-module}_LIBRARIES})
# Mantis-1427 : temporary fix
add_dependencies(${otb-module}-all otbapp_ImageEnvelope)
/*
* Copyright (C) 2005-2019 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.
*/
* Copyright (C) 2005-2019 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.
*/
#include "otbLearningApplicationBase.h"
#include "otbWrapperApplicationFactory.h"
......@@ -126,6 +126,8 @@ void DoInit() override
SetDocSeeAlso("OpenCV documentation for machine learning "
"http://docs.opencv.org/modules/ml/doc/ml.html ");
AddDocTag(Tags::Deprecated);
//Group IO
AddParameter( ParameterType_Group , "io" , "Input and output data" );
SetParameterDescription("io" ,
......
......@@ -50,12 +50,13 @@ protected:
SetName("TrainVectorRegression");
SetDescription(
"Train a regression algorithm based on geometries with "
"list of features to consider and a predictor.");
"list of predictor to consider and a label (dependent variable).");
SetDocLongDescription(
"This application trains a regression algorithm based on "
"a predictor geometries and a list of features to consider for "
"regression.\nThis application is based on LibSVM, OpenCV Machine "
"geometries containing list of predictors to consider for "
"regression as well as groundtruth labels.\n"
"This application is based on LibSVM, OpenCV Machine "
"Learning (2.3.1 and later), and Shark ML The output of this application "
"is a text model file, whose format corresponds to the ML model type "
"chosen. There is no image or vector data output.");
......@@ -69,7 +70,7 @@ protected:
Superclass::DoInit();
AddParameter(ParameterType_Float, "io.mse", "Mean Square Error");
SetParameterDescription("io.mse", "Mean square error computed with the validation predictors");
SetParameterDescription("io.mse", "Mean square error computed using the validation dataset");
SetParameterRole("io.mse", Role_Output);
this->MandatoryOff("io.mse");
}
......
......@@ -853,6 +853,40 @@ if(OTB_USE_OPENCV)
${TEMP}/apTvClTrainVectorRegressionModel.txt)
endif()
#----------- TrainImagesRegression TESTS ----------------
if(OTB_USE_OPENCV)
otb_test_application(NAME apTvClTrainImagesRegression
APP TrainImagesRegression
OPTIONS
-io.il ${INPUTDATA}/Classification/QB_1_ortho.tif?&bands=0,1,2
-io.ip ${INPUTDATA}/Classification/QB_1_ortho.tif?&bands=3
-io.vd ${INPUTDATA}/Classification/VectorData_QB1_utm31n.sqlite
-sample.nt 50
-classifier rf
-io.out ${TEMP}/apTvClTrainImagesRegressionModel.rf
-io.mse ${TEMP}/apTvClTrainImagesRegressionModel.txt
TESTENVOPTIONS ${TEMP}/apTvClTrainImagesRegressionModel.txt
VALID ${ascii_comparison}
${OTBAPP_BASELINE_FILES}/apTvClTrainImagesRegressionModel.txt
${TEMP}/apTvClTrainImagesRegressionModel.txt)
endif()
if(OTB_USE_OPENCV)
otb_test_application(NAME apTvClTrainImagesRegressionNoVD
APP TrainImagesRegression
OPTIONS
-io.il ${INPUTDATA}/Classification/QB_1_ortho.tif?&bands=0,1,2
-io.ip ${INPUTDATA}/Classification/QB_1_ortho.tif?&bands=3
-sample.nt 50
-classifier rf
-io.out ${TEMP}/apTvClTrainImagesRegressionNoVD.rf
-io.mse ${TEMP}/apTvClTrainImagesRegressionNoVD.txt
TESTENVOPTIONS ${TEMP}/apTvClTrainImagesRegressionNoVD.txt
VALID ${ascii_comparison}
${OTBAPP_BASELINE_FILES}/apTvClTrainImagesRegressionNoVD.txt
${TEMP}/apTvClTrainImagesRegressionNoVD.txt)
endif()
#----------- TrainVectorClassifier unsupervised TESTS ----------------
if(OTB_USE_SHARK)
otb_test_application(NAME apTvClTrainVectorUnsupervised
......