| 138 | } |
| 139 | |
| 140 | std::filesystem::path getModelFullPath(std::filesystem::path modelPath) |
| 141 | { |
| 142 | // First try to open from current working directory |
| 143 | if (std::filesystem::exists(modelPath)) { |
| 144 | return modelPath; |
| 145 | } |
| 146 | |
| 147 | // If not succeeded, try to open from config directory if path is relative |
| 148 | if (modelPath.is_relative()) { |
| 149 | auto modelPathinBinaryDir = CommandLine::binaryDirectory / modelPath; |
| 150 | if (std::filesystem::exists(modelPathinBinaryDir)) |
| 151 | return modelPathinBinaryDir; |
| 152 | } |
| 153 | |
| 154 | return modelPath; |
| 155 | } |
| 156 | |
| 157 | bool loadModelFromFile(std::filesystem::path modelPath) |
| 158 | { |
no outgoing calls
no test coverage detected