Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge master into develop #312

Merged
merged 1 commit into from
Sep 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/c_api/face_recognition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ std::string json_get_key_string(std::string json, const std::string &key) {
std::size_t start_idx = json.find(key);
std::string value = json.substr(start_idx);
value = value.substr(value.find(":") + 1);
value = value.substr(0, value.find(","));
value.resize(value.find(","));
value = value.substr(value.find("\"") + 1);
value = value.substr(0, value.find("\""));
value.resize(value.find("\""));
return value;
}

Expand Down Expand Up @@ -116,7 +116,7 @@ void load_face_recognition_model(const char *model_path, face_recognition_model_
std::string basepath = model_json_path.substr(0, split_pos);
split_pos = basepath.find_last_of("/");
split_pos = split_pos > 0 ? split_pos + 1 : 0;
basepath = basepath.substr(0, split_pos);
basepath.resize(split_pos);

// Parse JSON
std::string onnx_model_path = basepath + json_get_key_string(str, "model_paths");
Expand Down