Move all classifiers based on other libraries to dedicated namespaces

This commit is contained in:
Simon Giraudot 2019-01-07 11:50:02 +01:00
parent 9e20888127
commit c81fbe4688
21 changed files with 101 additions and 60 deletions

View File

@ -201,13 +201,13 @@ Example of cluster classification mesh (left: input, middle: clusters computed f
%Classification relies on a classifier: this classifier is an object that, from the set of values taken by the features at an input item, computes the probability that an input item belongs to one label or another. A model of the concept `CGAL::Classification::Classifier` must take the index of an input item and store the probability associated to each label in a vector. If a classifier returns the value 1 for a pair of label and input item, it means that this item belongs to this label with certainty; values close to 0 mean that this item is not likely to belong to this label. %Classification relies on a classifier: this classifier is an object that, from the set of values taken by the features at an input item, computes the probability that an input item belongs to one label or another. A model of the concept `CGAL::Classification::Classifier` must take the index of an input item and store the probability associated to each label in a vector. If a classifier returns the value 1 for a pair of label and input item, it means that this item belongs to this label with certainty; values close to 0 mean that this item is not likely to belong to this label.
\cgal provides four models for this concept, [ETHZ_random_forest_classifier](@ref CGAL::Classification::ETHZ_random_forest_classifier), [OpenCV_random_forest_classifier](@ref CGAL::Classification::OpenCV_random_forest_classifier), [TensorFlow_neural_network_classifier](@ref CGAL::Classification::TensorFlow_neural_network_classifier) and [Sum_of_weighted_features_classifier](@ref CGAL::Classification::Sum_of_weighted_features_classifier). \cgal provides four models for this concept, [ETHZ::Random_forest_classifier](@ref CGAL::Classification::ETHZ::Random_forest_classifier), [OpenCV::Random_forest_classifier](@ref CGAL::Classification::OpenCV::Random_forest_classifier), [TensorFlow::Neural_network_classifier](@ref CGAL::Classification::TensorFlow::Neural_network_classifier) and [Sum_of_weighted_features_classifier](@ref CGAL::Classification::Sum_of_weighted_features_classifier).
To perform classification based on four classifiers, please refer to \ref Classification_classification_functions. To perform classification based on four classifiers, please refer to \ref Classification_classification_functions.
\subsection Classification_ETHZ_random_forest ETHZ Random Forest \subsection Classification_ETHZ_random_forest ETHZ Random Forest
\cgal provides [ETHZ_random_forest_classifier](@ref CGAL::Classification::ETHZ_random_forest_classifier), \cgal provides [ETHZ::Random_forest_classifier](@ref CGAL::Classification::ETHZ::Random_forest_classifier),
a classifier based on the Random Forest Template Library developed by a classifier based on the Random Forest Template Library developed by
Stefan Walk at ETH Zurich \cgalCite{cgal:w-erftl-14} (the library is Stefan Walk at ETH Zurich \cgalCite{cgal:w-erftl-14} (the library is
distributed under the MIT license and is included with the \cgal release, distributed under the MIT license and is included with the \cgal release,
@ -232,13 +232,13 @@ to README provided in the [ETH Zurich's code archive](https://www.ethz.ch/conten
\subsection Classification_OpenCV_random_forest OpenCV Random Forest \subsection Classification_OpenCV_random_forest OpenCV Random Forest
The second classifier is [OpenCV_random_forest_classifier](@ref CGAL::Classification::OpenCV_random_forest_classifier). The second classifier is [OpenCV::Random_forest_classifier](@ref CGAL::Classification::OpenCV::Random_forest_classifier).
It uses the \ref thirdpartyOpenCV library, more specifically the It uses the \ref thirdpartyOpenCV library, more specifically the
[Random Trees](http://docs.opencv.org/2.4/modules/ml/doc/random_trees.html) [Random Trees](http://docs.opencv.org/2.4/modules/ml/doc/random_trees.html)
package. package.
Note that this classifier usually produces results with a lower Note that this classifier usually produces results with a lower
quality than [ETHZ_random_forest_classifier](@ref CGAL::Classification::ETHZ_random_forest_classifier). quality than [ETHZ::Random_forest_classifier](@ref CGAL::Classification::ETHZ::Random_forest_classifier).
It is provided for the sake of completeness and for testing purposes, It is provided for the sake of completeness and for testing purposes,
but if you are not sure what to use, we advise using the ETHZ Random but if you are not sure what to use, we advise using the ETHZ Random
@ -251,7 +251,7 @@ of OpenCV.
\subsection Classification_TensorFlow_neural_network TensorFlow Neural Network \subsection Classification_TensorFlow_neural_network TensorFlow Neural Network
\cgal provides [TensorFlow_neural_network_classifier](@ref CGAL::Classification::TensorFlow_neural_network_classifier). \cgal provides [TensorFlow::Neural_network_classifier](@ref CGAL::Classification::TensorFlow::Neural_network_classifier).
It uses the C++ API of the \ref thirdpartyTensorFlow library. It uses the C++ API of the \ref thirdpartyTensorFlow library.
@ -508,19 +508,19 @@ The following example:
\subsection Classification_example_ethz_random_forest ETHZ Random Forest \subsection Classification_example_ethz_random_forest ETHZ Random Forest
The following example shows how to use the classifier [ETHZ_random_forest_classifier](@ref CGAL::Classification::ETHZ_random_forest_classifier) using an input training set. The following example shows how to use the classifier [ETHZ::Random_forest_classifier](@ref CGAL::Classification::ETHZ::Random_forest_classifier) using an input training set.
\cgalExample{Classification/example_ethz_random_forest.cpp} \cgalExample{Classification/example_ethz_random_forest.cpp}
\subsection Classification_example_opencv_random_forest OpenCV Random Forest \subsection Classification_example_opencv_random_forest OpenCV Random Forest
The following example shows how to use the classifier [OpenCV_random_forest_classifier](@ref CGAL::Classification::OpenCV_random_forest_classifier) using an input training set. The following example shows how to use the classifier [OpenCV::Random_forest_classifier](@ref CGAL::Classification::OpenCV::Random_forest_classifier) using an input training set.
\cgalExample{Classification/example_opencv_random_forest.cpp} \cgalExample{Classification/example_opencv_random_forest.cpp}
\subsection Classification_example_tensorflow_neural_network TensorFlow Neural Network \subsection Classification_example_tensorflow_neural_network TensorFlow Neural Network
The following example shows how to use the classifier [TensorFlow_neural_network_classifier](@ref CGAL::Classification::TensorFlow_neural_network_classifier) using an input training set. The following example shows how to use the classifier [TensorFlow::Neural_network_classifier](@ref CGAL::Classification::TensorFlow::Neural_network_classifier) using an input training set.
\cgalExample{Classification/example_tensorflow_neural_network.cpp} \cgalExample{Classification/example_tensorflow_neural_network.cpp}
@ -530,7 +530,7 @@ The following example:
- reads a mesh in OFF format; - reads a mesh in OFF format;
- automatically generates features on 5 scales; - automatically generates features on 5 scales;
- loads a configuration file for classifier [ETHZ_random_forest_classifier](@ref CGAL::Classification::ETHZ_random_forest_classifier); - loads a configuration file for classifier [ETHZ::Random_forest_classifier](@ref CGAL::Classification::ETHZ::Random_forest_classifier);
- runs the algorithm using the graphcut regularization. - runs the algorithm using the graphcut regularization.
\cgalExample{Classification/example_mesh_classification.cpp} \cgalExample{Classification/example_mesh_classification.cpp}
@ -545,7 +545,7 @@ The following example:
- detects plane using the algorithm `CGAL::Shape_detection_3::Region_growing`; - detects plane using the algorithm `CGAL::Shape_detection_3::Region_growing`;
- creates [Cluster](@ref CGAL::Classification::Cluster) objects from these detected planes; - creates [Cluster](@ref CGAL::Classification::Cluster) objects from these detected planes;
- computes cluster features from the pointwise features; - computes cluster features from the pointwise features;
- loads a configuration file for classifier [ETHZ_random_forest_classifier](@ref CGAL::Classification::ETHZ_random_forest_classifier); - loads a configuration file for classifier [ETHZ::Random_forest_classifier](@ref CGAL::Classification::ETHZ::Random_forest_classifier);
- runs the algorithm using the raw algorithm. - runs the algorithm using the raw algorithm.
\cgalExample{Classification/example_cluster_classification.cpp} \cgalExample{Classification/example_cluster_classification.cpp}

View File

@ -13,8 +13,9 @@ Concept describing a classifier used by classification functions (see
`CGAL::Classification::classify_with_graphcut()`). `CGAL::Classification::classify_with_graphcut()`).
\cgalHasModel `CGAL::Classification::Sum_of_weighted_features_classifier` \cgalHasModel `CGAL::Classification::Sum_of_weighted_features_classifier`
\cgalHasModel `CGAL::Classification::ETHZ_random_forest_classifier` \cgalHasModel `CGAL::Classification::ETHZ::Random_forest_classifier`
\cgalHasModel `CGAL::Classification::OpenCV_random_forest_classifier` \cgalHasModel `CGAL::Classification::OpenCV::Random_forest_classifier`
\cgalHasModel `CGAL::Classification::TensorFlow::Neural_network_classifier`
*/ */
class Classifier class Classifier

View File

@ -14,6 +14,21 @@ Functions that perform classification based on a set of labels and a classifier,
Classifiers are functors that, given a label set and an input item, associate this input item with an energy for each label. This energy measures the likelihood of the item to belong to this label. Classifiers are functors that, given a label set and an input item, associate this input item with an energy for each label. This energy measures the likelihood of the item to belong to this label.
\defgroup PkgClassificationClassifiersETHZ ETHZ
\ingroup PkgClassificationClassifiers
Classifiers that use the ETHZ library.
\defgroup PkgClassificationClassifiersOpenCV OpenCV
\ingroup PkgClassificationClassifiers
Classifiers that use the \ref thirdpartyOpenCV library.
\defgroup PkgClassificationClassifiersTensorFlow TensorFlow
\ingroup PkgClassificationClassifiers
Classifiers that use the \ref thirdpartyTensorFlow library.
\defgroup PkgClassificationDataStructures Common Data Structures \defgroup PkgClassificationDataStructures Common Data Structures
\ingroup PkgClassificationRef \ingroup PkgClassificationRef
@ -86,9 +101,9 @@ Data structures specialized to classify clusters.
## Classifiers ## ## Classifiers ##
- `CGAL::Classification::ETHZ_random_forest_classifier` - `CGAL::Classification::ETHZ::Random_forest_classifier`
- `CGAL::Classification::OpenCV_random_forest_classifier` - `CGAL::Classification::OpenCV::Random_forest_classifier`
- `CGAL::Classification::TensorFlow_neural_network_classifier<ActivationFunction>` - `CGAL::Classification::TensorFlow::Neural_network_classifier<ActivationFunction>`
- `CGAL::Classification::Sum_of_weighted_features_classifier` - `CGAL::Classification::Sum_of_weighted_features_classifier`
## Common Data Structures ## ## Common Data Structures ##

View File

@ -191,7 +191,7 @@ int main (int argc, char** argv)
std::vector<int> label_indices(clusters.size(), -1); std::vector<int> label_indices(clusters.size(), -1);
std::cerr << "Using ETHZ Random Forest Classifier" << std::endl; std::cerr << "Using ETHZ Random Forest Classifier" << std::endl;
Classification::ETHZ_random_forest_classifier classifier (labels, features); Classification::ETHZ::Random_forest_classifier classifier (labels, features);
std::cerr << "Loading configuration" << std::endl; std::cerr << "Loading configuration" << std::endl;
std::ifstream in_config (filename_config, std::ios_base::in | std::ios_base::binary); std::ifstream in_config (filename_config, std::ios_base::in | std::ios_base::binary);

View File

@ -91,7 +91,7 @@ int main (int argc, char** argv)
std::vector<int> label_indices(pts.size(), -1); std::vector<int> label_indices(pts.size(), -1);
std::cerr << "Using ETHZ Random Forest Classifier" << std::endl; std::cerr << "Using ETHZ Random Forest Classifier" << std::endl;
Classification::ETHZ_random_forest_classifier classifier (labels, features); Classification::ETHZ::Random_forest_classifier classifier (labels, features);
std::cerr << "Training" << std::endl; std::cerr << "Training" << std::endl;
t.reset(); t.reset();

View File

@ -85,7 +85,7 @@ int main (int argc, char** argv)
std::vector<int> label_indices(mesh.number_of_faces(), -1); std::vector<int> label_indices(mesh.number_of_faces(), -1);
std::cerr << "Using ETHZ Random Forest Classifier" << std::endl; std::cerr << "Using ETHZ Random Forest Classifier" << std::endl;
Classification::ETHZ_random_forest_classifier classifier (labels, features); Classification::ETHZ::Random_forest_classifier classifier (labels, features);
std::cerr << "Loading configuration" << std::endl; std::cerr << "Loading configuration" << std::endl;
std::ifstream in_config (filename_config, std::ios_base::in | std::ios_base::binary); std::ifstream in_config (filename_config, std::ios_base::in | std::ios_base::binary);

View File

@ -90,7 +90,7 @@ int main (int argc, char** argv)
std::vector<int> label_indices(pts.size(), -1); std::vector<int> label_indices(pts.size(), -1);
std::cerr << "Using OpenCV Random Forest Classifier" << std::endl; std::cerr << "Using OpenCV Random Forest Classifier" << std::endl;
Classification::OpenCV_random_forest_classifier classifier (labels, features); Classification::OpenCV::Random_forest_classifier classifier (labels, features);
std::cerr << "Training" << std::endl; std::cerr << "Training" << std::endl;
t.reset(); t.reset();

View File

@ -91,7 +91,7 @@ int main (int argc, char** argv)
std::vector<int> label_indices(pts.size(), -1); std::vector<int> label_indices(pts.size(), -1);
std::cerr << "Using TensorFlow neural network Classifier" << std::endl; std::cerr << "Using TensorFlow neural network Classifier" << std::endl;
Classification::TensorFlow_neural_network_classifier<> classifier (labels, features); Classification::TensorFlow::Neural_network_classifier<> classifier (labels, features);
std::cerr << "Training" << std::endl; std::cerr << "Training" << std::endl;
t.reset(); t.reset();

View File

@ -25,14 +25,14 @@
#include <CGAL/Classification/classify.h> #include <CGAL/Classification/classify.h>
#include <CGAL/Classification/Sum_of_weighted_features_classifier.h> #include <CGAL/Classification/Sum_of_weighted_features_classifier.h>
#include <CGAL/Classification/ETHZ_random_forest_classifier.h> #include <CGAL/Classification/ETHZ/Random_forest_classifier.h>
#ifdef CGAL_LINKED_WITH_OPENCV #ifdef CGAL_LINKED_WITH_OPENCV
#include <CGAL/Classification/OpenCV_random_forest_classifier.h> #include <CGAL/Classification/OpenCV/Random_forest_classifier.h>
#endif #endif
#ifdef CGAL_LINKED_WITH_TENSORFLOW #ifdef CGAL_LINKED_WITH_TENSORFLOW
#include <CGAL/Classification/TensorFlow_neural_network_classifier.h> #include <CGAL/Classification/TensorFlow/Neural_network_classifier.h>
#endif #endif
#include <CGAL/Classification/Cluster.h> #include <CGAL/Classification/Cluster.h>

View File

@ -42,8 +42,8 @@
# pragma warning(disable:4996) # pragma warning(disable:4996)
#endif #endif
#include <CGAL/Classification/internal/auxiliary/random-forest/node-gini.hpp> #include <CGAL/Classification/ETHZ/internal/random-forest/node-gini.hpp>
#include <CGAL/Classification/internal/auxiliary/random-forest/forest.hpp> #include <CGAL/Classification/ETHZ/internal/random-forest/forest.hpp>
#include <CGAL/tags.h> #include <CGAL/tags.h>
@ -61,8 +61,10 @@ namespace CGAL {
namespace Classification { namespace Classification {
namespace ETHZ {
/*! /*!
\ingroup PkgClassificationClassifiers \ingroup PkgClassificationClassifiersETHZ
\brief %Classifier based on the ETH Zurich version of random forest algorithm \cgalCite{cgal:w-erftl-14}. \brief %Classifier based on the ETH Zurich version of random forest algorithm \cgalCite{cgal:w-erftl-14}.
@ -70,7 +72,7 @@ namespace Classification {
\cgalModels `CGAL::Classification::Classifier` \cgalModels `CGAL::Classification::Classifier`
*/ */
class ETHZ_random_forest_classifier class Random_forest_classifier
{ {
typedef CGAL::internal::liblearning::RandomForest::RandomForest typedef CGAL::internal::liblearning::RandomForest::RandomForest
< CGAL::internal::liblearning::RandomForest::NodeGini < CGAL::internal::liblearning::RandomForest::NodeGini
@ -89,7 +91,7 @@ public:
\brief Instantiate the classifier using the sets of `labels` and `features`. \brief Instantiate the classifier using the sets of `labels` and `features`.
*/ */
ETHZ_random_forest_classifier (const Label_set& labels, Random_forest_classifier (const Label_set& labels,
const Feature_set& features) const Feature_set& features)
: m_labels (labels), m_features (features), m_rfc (NULL) : m_labels (labels), m_features (features), m_rfc (NULL)
{ } { }
@ -105,7 +107,7 @@ public:
than the ones used by `other`, and in the same order. than the ones used by `other`, and in the same order.
*/ */
ETHZ_random_forest_classifier (const ETHZ_random_forest_classifier& other, Random_forest_classifier (const Random_forest_classifier& other,
const Feature_set& features) const Feature_set& features)
: m_labels (other.m_labels), m_features (features), m_rfc (NULL) : m_labels (other.m_labels), m_features (features), m_rfc (NULL)
{ {
@ -115,7 +117,7 @@ public:
} }
/// \cond SKIP_IN_MANUAL /// \cond SKIP_IN_MANUAL
~ETHZ_random_forest_classifier () ~Random_forest_classifier ()
{ {
if (m_rfc != NULL) if (m_rfc != NULL)
delete m_rfc; delete m_rfc;
@ -327,6 +329,13 @@ public:
} }
/// \cond SKIP_IN_MANUAL
// Backward compatibility
typedef ETHZ::Random_forest_classifier ETHZ_random_forest_classifier;
/// \endcond
}
} }
#endif // CGAL_CLASSIFICATION_ETHZ_RANDOM_FOREST_CLASSIFIER_H #endif // CGAL_CLASSIFICATION_ETHZ_RANDOM_FOREST_CLASSIFIER_H

View File

@ -37,8 +37,10 @@ namespace CGAL {
namespace Classification { namespace Classification {
namespace OpenCV {
/*! /*!
\ingroup PkgClassificationClassifiers \ingroup PkgClassificationClassifiersOpenCV
\brief %Classifier based on the OpenCV version of random forest algorithm. \brief %Classifier based on the OpenCV version of random forest algorithm.
@ -46,7 +48,7 @@ namespace Classification {
\cgalModels `CGAL::Classification::Classifier` \cgalModels `CGAL::Classification::Classifier`
*/ */
class OpenCV_random_forest_classifier class Random_forest_classifier
{ {
const Label_set& m_labels; const Label_set& m_labels;
const Feature_set& m_features; const Feature_set& m_features;
@ -80,7 +82,7 @@ public:
\param max_number_of_trees_in_the_forest The maximum number of trees in the forest (surprise, surprise). Typically the more trees you have the better the accuracy. However, the improvement in accuracy generally diminishes and asymptotes pass a certain number of trees. Also to keep in mind, the number of tree increases the prediction time linearly. \param max_number_of_trees_in_the_forest The maximum number of trees in the forest (surprise, surprise). Typically the more trees you have the better the accuracy. However, the improvement in accuracy generally diminishes and asymptotes pass a certain number of trees. Also to keep in mind, the number of tree increases the prediction time linearly.
\param forest_accuracy Sufficient accuracy (OOB error). \param forest_accuracy Sufficient accuracy (OOB error).
*/ */
OpenCV_random_forest_classifier (const Label_set& labels, Random_forest_classifier (const Label_set& labels,
const Feature_set& features, const Feature_set& features,
int max_depth = 20, int max_depth = 20,
int min_sample_count = 5, int min_sample_count = 5,
@ -98,7 +100,7 @@ public:
{ } { }
/// \cond SKIP_IN_MANUAL /// \cond SKIP_IN_MANUAL
~OpenCV_random_forest_classifier () ~Random_forest_classifier ()
{ {
#if (CV_MAJOR_VERSION < 3) #if (CV_MAJOR_VERSION < 3)
if (rtree != NULL) if (rtree != NULL)
@ -298,6 +300,13 @@ public:
} }
/// \cond SKIP_IN_MANUAL
// Backward compatibility
typedef OpenCV::Random_forest_classifier OpenCV_random_forest_classifier;
/// \endcond
}
} }
#endif // CGAL_CLASSIFICATION_OPENCV_RANDOM_FOREST_CLASSIFIER_H #endif // CGAL_CLASSIFICATION_OPENCV_RANDOM_FOREST_CLASSIFIER_H

View File

@ -47,11 +47,13 @@ namespace CGAL {
namespace Classification { namespace Classification {
namespace TensorFlow {
namespace TF = tensorflow; namespace TF = tensorflow;
namespace TFops = tensorflow::ops; namespace TFops = tensorflow::ops;
/*! /*!
\ingroup PkgClassificationClassifiers \ingroup PkgClassificationClassifiersTensorFlow
\brief %Classifier based on the TensorFlow version of neural network. \brief %Classifier based on the TensorFlow version of neural network.
@ -81,7 +83,7 @@ namespace TFops = tensorflow::ops;
\cgalModels `CGAL::Classification::Classifier` \cgalModels `CGAL::Classification::Classifier`
*/ */
template <typename ActivationFunction = tensorflow::ops::Relu> template <typename ActivationFunction = tensorflow::ops::Relu>
class TensorFlow_neural_network_classifier class Neural_network_classifier
{ {
bool m_verbose; bool m_verbose;
@ -123,14 +125,14 @@ public:
\brief Instantiate the classifier using the sets of `labels` and `features`. \brief Instantiate the classifier using the sets of `labels` and `features`.
*/ */
TensorFlow_neural_network_classifier (const Label_set& labels, Neural_network_classifier (const Label_set& labels,
const Feature_set& features) const Feature_set& features)
: m_verbose (true), m_labels (labels), m_features (features) : m_verbose (true), m_labels (labels), m_features (features)
, m_root (NULL), m_ph_ft (NULL), m_ph_gt (NULL), m_loss(NULL), m_session (NULL) , m_root (NULL), m_ph_ft (NULL), m_ph_gt (NULL), m_loss(NULL), m_session (NULL)
{ } { }
/// \cond SKIP_IN_MANUAL /// \cond SKIP_IN_MANUAL
~TensorFlow_neural_network_classifier () ~Neural_network_classifier ()
{ {
clear(); clear();
} }
@ -1014,7 +1016,7 @@ template <typename ConcurrencyTag,
typename ProbabilitiesRanges> typename ProbabilitiesRanges>
void classify (const ItemRange& input, void classify (const ItemRange& input,
const Label_set& labels, const Label_set& labels,
const TensorFlow_neural_network_classifier& classifier, const TensorFlow::Neural_network_classifier& classifier,
LabelIndexRange& output, LabelIndexRange& output,
ProbabilitiesRanges& probabilities) ProbabilitiesRanges& probabilities)
{ {
@ -1067,7 +1069,7 @@ template <typename ConcurrencyTag,
typename LabelIndexRange> typename LabelIndexRange>
void classify (const ItemRange& input, void classify (const ItemRange& input,
const Label_set& labels, const Label_set& labels,
const TensorFlow_neural_network_classifier& classifier, const TensorFlow::Neural_network_classifier& classifier,
LabelIndexRange& output) LabelIndexRange& output)
{ {
std::cerr << "Classify with TensorFlow classifier" << std::endl; std::cerr << "Classify with TensorFlow classifier" << std::endl;
@ -1113,6 +1115,7 @@ void classify (const ItemRange& input,
} }
}
} }

View File

@ -28,7 +28,7 @@ typedef Classification::Feature_handle
typedef Classification::Label_set Label_set; typedef Classification::Label_set Label_set;
typedef Classification::Feature_set Feature_set; typedef Classification::Feature_set Feature_set;
typedef Classification::ETHZ_random_forest_classifier Classifier; typedef Classification::ETHZ::Random_forest_classifier Classifier;
typedef Classification::Planimetric_grid<Kernel, Point_set, Point_map> Planimetric_grid; typedef Classification::Planimetric_grid<Kernel, Point_set, Point_map> Planimetric_grid;
typedef Classification::Point_set_neighborhood<Kernel, Point_set, Point_map> Neighborhood; typedef Classification::Point_set_neighborhood<Kernel, Point_set, Point_map> Neighborhood;

View File

@ -35,13 +35,17 @@ Release date: March 2019
### Classification ### Classification
- Added a new experimental classifier - Added a new experimental classifier
`TensorFlow_neural_network_classifier`. `TensorFlow::Neural_network_classifier`.
- The training algorithm of `ETHZ_random_forest_classifier` was - For uniformity, `ETHZ_random_forest_classifier` is renamed
`ETHZ::Random_forest_classifier` and `OpenCV_random_forest_classifier`
is renamed `OpenCV::Random_forest_classifier`.
- The training algorithm of `ETHZ::Random_forest_classifier` was
parallelized. parallelized.
- Added a constructor to copy a `ETHZ_random_forest_classifier` - Added a constructor to copy a `ETHZ::Random_forest_classifier` using a
using a different data set as input. different data set as input.
- Added 3 new geometric features, `Height_above`, `Height_below` and - Added 3 new geometric features, `Height_above`, `Height_below` and
`Vertical_range`. `Vertical_range`.

View File

@ -11,13 +11,13 @@
#include <CGAL/Classification/Feature_set.h> #include <CGAL/Classification/Feature_set.h>
#include <CGAL/Classification/Label_set.h> #include <CGAL/Classification/Label_set.h>
#include <CGAL/Classification/Sum_of_weighted_features_classifier.h> #include <CGAL/Classification/Sum_of_weighted_features_classifier.h>
#include <CGAL/Classification/ETHZ_random_forest_classifier.h> #include <CGAL/Classification/ETHZ/Random_forest_classifier.h>
#ifdef CGAL_LINKED_WITH_OPENCV #ifdef CGAL_LINKED_WITH_OPENCV
#include <CGAL/Classification/OpenCV_random_forest_classifier.h> #include <CGAL/Classification/OpenCV/Random_forest_classifier.h>
#endif #endif
#ifdef CGAL_LINKED_WITH_TENSORFLOW #ifdef CGAL_LINKED_WITH_TENSORFLOW
#include <CGAL/Classification/TensorFlow_neural_network_classifier.h> #include <CGAL/Classification/TensorFlow/Neural_network_classifier.h>
#endif #endif
class Item_classification_base class Item_classification_base
@ -28,13 +28,13 @@ public:
typedef CGAL::Classification::Label_set Label_set; typedef CGAL::Classification::Label_set Label_set;
typedef CGAL::Classification::Feature_set Feature_set; typedef CGAL::Classification::Feature_set Feature_set;
typedef CGAL::Classification::Sum_of_weighted_features_classifier Sum_of_weighted_features; typedef CGAL::Classification::Sum_of_weighted_features_classifier Sum_of_weighted_features;
typedef CGAL::Classification::ETHZ_random_forest_classifier ETHZ_random_forest; typedef CGAL::Classification::ETHZ::Random_forest_classifier ETHZ_random_forest;
#ifdef CGAL_LINKED_WITH_OPENCV #ifdef CGAL_LINKED_WITH_OPENCV
typedef CGAL::Classification::OpenCV_random_forest_classifier Random_forest; typedef CGAL::Classification::OpenCV::Random_forest_classifier Random_forest;
#endif #endif
#ifdef CGAL_LINKED_WITH_TENSORFLOW #ifdef CGAL_LINKED_WITH_TENSORFLOW
typedef CGAL::Classification::TensorFlow_neural_network_classifier<> Neural_network; typedef CGAL::Classification::TensorFlow::Neural_network_classifier<> Neural_network;
#endif #endif
public: public: