#include <mv_common.h>
-namespace Mediavision {
-namespace MachineLearning {
-namespace Exception {
+namespace mediavision {
+namespace machine_learning {
+namespace exception {
class BaseException : public std::exception {
private:
#include "data_augment_flip.h"
#include "data_augment_rotate.h"
-namespace Mv
+namespace mediavision
{
-namespace FaceRecognition
+namespace machine_learning
+{
+namespace face_recognition
{
-namespace Status
+namespace status
{
enum {
NONE = 0,
INFERENCED,
DELETED
};
-} // Status
+} // status
-namespace Mode
+namespace mode
{
enum {
REGISTER = 0,
INFERENCE,
DELETE
};
-} // Mode
+} // mode
-} // FaceRecognition
-} // Mv
+} // face_recognition
typedef struct {
unsigned int mode;
};
+} // machine_learning
+} // mediavision
+
#endif
\ No newline at end of file
{
namespace machine_learning
{
+
template <typename T, typename V>
class FaceRecognitionAdapter : public mediavision::common::ITask<T, V> {
private:
void perform();
V& getOutput();
};
+
} // machine_learning
} // mediavision
using namespace std;
using namespace mediavision::inference;
using namespace TrainingEngineInterface::Common;
-using namespace Mv::FaceRecognition::Status;
-using namespace Mediavision::MachineLearning::Exception;
+using namespace mediavision::machine_learning::face_recognition::status;
+using namespace mediavision::machine_learning::exception;
+
+namespace mediavision
+{
+namespace machine_learning
+{
FaceRecognition::FaceRecognition() :
_status(NONE), _internal(), _backbone(), _face_net_info(), _training_model(), _label_manager()
return _result;
}
+
+} // machine_learning
+} // mediavision
\ No newline at end of file
using namespace std;
using namespace MediaVision::Common;
-using namespace Mediavision::MachineLearning::Exception;
+using namespace mediavision::machine_learning::exception;
+using namespace mediavision::machine_learning::face_recognition;
namespace mediavision
{
namespace machine_learning
{
+
template <typename T, typename V>
FaceRecognitionAdapter<T, V>::FaceRecognitionAdapter()
{
template <typename T, typename V>
void FaceRecognitionAdapter<T, V>::perform()
{
- if (_source.mode == Mv::FaceRecognition::Mode::REGISTER) {
+ if (_source.mode == mode::REGISTER) {
for (auto& s : _source.register_src) {
int ret = _face_recognition->RegisterNewFace(s.first, s.second);
if (ret != MEDIA_VISION_ERROR_NONE)
return;
}
- if (_source.mode == Mv::FaceRecognition::Mode::INFERENCE) {
+ if (_source.mode == mode::INFERENCE) {
int ret = _face_recognition->RecognizeFace(_source.inference_src);
if (ret == MEDIA_VISION_ERROR_NO_DATA)
throw NoData("Label not found.");
return;
}
- if (_source.mode == Mv::FaceRecognition::Mode::DELETE) {
+ if (_source.mode == mode::DELETE) {
for (auto& l : _source.labels) {
int ret = _face_recognition->DeleteLabel(l);
if (ret != MEDIA_VISION_ERROR_NONE)
using namespace std;
using namespace mediavision::common;
using namespace mediavision::machine_learning;
-using namespace Mv::FaceRecognition;
-using namespace Mediavision::MachineLearning::Exception;
+using namespace mediavision::machine_learning::face_recognition;
+using namespace mediavision::machine_learning::exception;
int mv_face_recognition_create_open(mv_face_recognition_h *handle)
{
Context *context = static_cast<Context *>(handle);
auto itask = static_cast<ITask<mv_face_recognition_input_s, mv_face_recognition_result_s> *>(context->__itasks["face_recognition"]);
- mv_face_recognition_input_s input = { Mode::REGISTER };
+ mv_face_recognition_input_s input = { mode::REGISTER };
input.register_src.clear();
input.register_src.insert(make_pair(source, string(label)));
Context *context = static_cast<Context *>(handle);
auto itask = static_cast<ITask<mv_face_recognition_input_s, mv_face_recognition_result_s> *>(context->__itasks["face_recognition"]);
- mv_face_recognition_input_s input = { Mode::DELETE };
+ mv_face_recognition_input_s input = { mode::DELETE };
input.labels.clear();
input.labels.push_back(string(label));
Context *context = static_cast<Context *>(handle);
auto itask = static_cast<ITask<mv_face_recognition_input_s, mv_face_recognition_result_s> *>(context->__itasks["face_recognition"]);
- mv_face_recognition_input_s input = { Mode::INFERENCE };
+ mv_face_recognition_input_s input = { mode::INFERENCE };
input.inference_src = source;
itask->setInput(input);
#include "nntrainer_dsm.h"
using namespace std;
-using namespace Mediavision::MachineLearning::Exception;
+using namespace mediavision::machine_learning::exception;
void NNTrainerDSM::PrintHeader(FeaVecHeader& fvh)
{
#include "nntrainer_fvm.h"
using namespace std;
-using namespace Mediavision::MachineLearning::Exception;
+using namespace mediavision::machine_learning::exception;
NNTrainerFVM::NNTrainerFVM(const string feature_vector_file)
: FeatureVectorManager(feature_vector_file)
using namespace std;
using namespace TrainingEngineInterface::Common;
-using namespace Mediavision::MachineLearning::Exception;
+using namespace mediavision::machine_learning::exception;
SimpleShot::SimpleShot(const mv_inference_backend_type_e backend_type,
const mv_inference_target_device_e target_type,
#include "data_augment_rotate.h"
using namespace std;
-using namespace Mediavision::MachineLearning::Exception;
+using namespace mediavision::machine_learning::exception;
DataAugmentRotate::DataAugmentRotate(unsigned int degree) : _degree(degree)
{
#include "feature_vector_manager.h"
using namespace std;
-using namespace Mediavision::MachineLearning::Exception;
+using namespace mediavision::machine_learning::exception;
FeatureVectorManager::FeatureVectorManager(const string feature_vector_file)
: _feature_vector_file(feature_vector_file)
#include "label_manager.h"
using namespace std;
-using namespace Mediavision::MachineLearning::Exception;
+using namespace mediavision::machine_learning::exception;
LabelManager::LabelManager(string label_file, double decision_threshold) : _labels_and_files(), _label_file(label_file)
{
using namespace std;
using namespace TrainingEngineInterface::Common;
-using namespace Mediavision::MachineLearning::Exception;
+using namespace mediavision::machine_learning::exception;
TrainingModel::TrainingModel(const mv_inference_backend_type_e backend_type,
const mv_inference_target_device_e target_type,