// label_cnt can be changed every time the training is performed and all data set will be used for the training
// again in this case. So make sure to clear previous data set before next training.
_training_model->clearDataSet(data_set);
+ _result.is_valid = false;
_status = WorkingStatus::REGISTERED;
} catch (const BaseException &e) {
LOGE("%s", e.what());
importLabel();
unsigned int target_label_idx = _label_manager->getLabelIndex(label_name);
-
auto label_cnt_ori = _label_manager->getMaxLabel();
+ LOGD("Current label count is %zu", label_cnt_ori);
+ LOGD("The index of label name(%s) is %d", label_name.c_str(), target_label_idx);
+
// Get label count after removing a given label from the label file.
_label_manager->removeLabel(label_name);
auto label_cnt = _label_manager->getMaxLabel();
+
+ LOGD("Current label count is %zu after removing the label(%s)", label_cnt, label_name.c_str());
+
unique_ptr<FeatureVectorManager> fvm = make_unique<FaceRecognitionFVM>(_config.feature_vector_file_path);
unique_ptr<FeatureVectorManager> fvm_new =
make_unique<FaceRecognitionFVM>(_config.feature_vector_file_path + ".new");
// feature vectors corresponding to given label aren't removed yet from feature vector file.
// So label_cnt_ori is needed.
+ LOGD("Load the original feature vector data from the feature vector file.");
data_set->loadDataSet(fvm->getFileName(), label_cnt_ori);
vector<vector<float> > feature_vectors_old = data_set->getData();
// TODO. Remove existing internal model file.
+ LOGD("Load the new feature vector data from the feature vector file.");
new_data_set->loadDataSet(_config.feature_vector_file_path, label_cnt);
_training_model->applyDataSet(new_data_set);
_training_model->compile();
LOGD("No training data so removed all relevant files.");
}
+ _result.is_valid = false;
_status = WorkingStatus::DELETED;
} catch (const BaseException &e) {
LOGE("%s", e.what());
size_t num_of_confidences = 0;
const float *confidences = nullptr;
- ret = mv_face_recognition_get_confidence(handle, &confidences, &num_of_confidences);
- ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
-
- // num_of_confidence must be 2 because of no inference request.
- ASSERT_EQ(num_of_confidences, 2);
-
// If input is last one then request an inference.
if (idx == image_names.size() - 1) {
ret = mv_face_recognition_inference(handle, mv_source);
ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
}
- // Remove "2929" label from the label file.
- ret = mv_face_recognition_unregister(handle, "2929");
+ // Remove a label, "7779".
+ ret = mv_face_recognition_unregister(handle, "7779");
ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
- ret = mv_face_recognition_get_confidence(handle, &confidences, &num_of_confidences);
- ASSERT_EQ(ret, MEDIA_VISION_ERROR_NONE);
-
- // num_of_confidences must be 3 yet because of no inference request.
- ASSERT_EQ(num_of_confidences, 3);
-
const string image_path = string(TRAINING_IMAGE_PATH) + image_names[0];
mv_source_h mv_source = NULL;