3#include "../_cexports/c_polimago.h"
5#include "../global.hpp"
6#include "../string.hpp"
7#include "predictor_base.hpp"
30 if (TrainingParameters().Usage != CExports::TClassifierUsage::CU_Regression)
37 static CExports::TCLF LoadInternal (
const String & fileName)
39 CExports::TCLF predictor =
nullptr;
41 CVB_CALL_CAPI_CHECKED (PMOpenClfTyped(fileName.c_str(), predictor));
45 void SaveFunction (
const String &fileName)
const override
47 CVB_CALL_CAPI_CHECKED (PMSaveClfTyped(fileName.c_str(),
Handle()));
52 return thisObjectName_;
93 return std::make_unique<RegressionPredictor>(fileName);
103 return static_cast<int>(CVB_CALL_CAPI(PMGetOutputDimension(
Handle())));
115 VerifyCompatibility(img, pos);
118 CVB_CALL_CAPI_CHECKED (PMPredictVector(
Handle(), img.Handle(), pos.
X(), pos.
Y(), &retval[0]));
123 const std::string thisObjectName_ =
"Polimago Regression Predictor";
The Common Vision Blox image.
Definition: decl_image.hpp:45
T X() const noexcept
Gets the x-component of the point.
Definition: point_2d.hpp:86
T Y() const noexcept
Gets the y-component of the point.
Definition: point_2d.hpp:106
void * Handle() const noexcept
Classic API Polimago handle.
Definition: predictor_base.hpp:69
Base class for Polimago predictors.
Definition: predictor_base.hpp:293
Polimago Regression predictor.
Definition: regression_predictor.hpp:24
std::vector< double > PredictVector(const Image &img, Point2D< int > pos) const
Calculate a regression result on a given location.
Definition: regression_predictor.hpp:113
int RegressionDimension() const
Regression result dimension.
Definition: regression_predictor.hpp:101
static std::unique_ptr< RegressionPredictor > Load(const String &fileName)
Load a saved predictor from a file.
Definition: regression_predictor.hpp:91
static std::unique_ptr< RegressionPredictor > FromHandle(ReleaseObjectGuard &&guard)
Creates predictor from a classic API handle.
Definition: regression_predictor.hpp:76
RegressionPredictor(const String &fileName)
Load a saved Polimago regression predictor from a file.
Definition: regression_predictor.hpp:61
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24