opt.提高基建技能识别准确率

This commit is contained in:
MistEO
2022-01-09 02:28:51 +08:00
parent 3f6601b21e
commit d528c3cb32
2 changed files with 7 additions and 2 deletions

View File

@@ -345,6 +345,7 @@ void asst::InfrastOperImageAnalyzer::skill_analyze()
[](const auto& lhs, const auto& rhs) -> bool {
return lhs.second.score < rhs.second.score;
});
double base_score = max_iter->second.score;
std::string base_id = max_iter->first.id;
size_t level_pos = 0;
// 倒着找第一个不是数字的。前面就是技能基础id名字后面的数字就是技能等级
@@ -356,9 +357,13 @@ void asst::InfrastOperImageAnalyzer::skill_analyze()
}
base_id = base_id.substr(0, level_pos);
std::string max_level;
for (const auto& [skill, _] : possible_skills) {
for (const auto& [skill, skill_mr] : possible_skills) {
if (size_t find_pos = skill.id.find(base_id);
find_pos != std::string::npos) {
// 得分差距过大的,直接忽略
if (base_score - skill_mr.score > 0.5) {
continue;
}
std::string cur_skill_level = skill.id.substr(base_id.size());
if (max_level.empty() || cur_skill_level > max_level) {
max_level = cur_skill_level;