| 73 | } |
| 74 | |
| 75 | std::string extractModelName(const std::string& filename) { |
| 76 | // Extract model name |
| 77 | std::string name = filename; |
| 78 | std::size_t found = name.find_last_of("/\\"); |
| 79 | if (found < name.size()) name = name.substr(found + 1); |
| 80 | found = name.find_last_of("."); |
| 81 | if (name.substr(found + 1) == "gz") { |
| 82 | name.erase(found, name.size() - found); |
| 83 | found = name.find_last_of("."); |
| 84 | } |
| 85 | if (found < name.size()) name.erase(found, name.size() - found); |
| 86 | return name; |
| 87 | } |