fixing tilt on windows ci

This commit is contained in:
matlabbe
2026-06-01 21:12:04 -07:00
parent 858e1ad042
commit b88a504838
3 changed files with 15 additions and 4 deletions
+4 -1
View File
@@ -48,7 +48,10 @@ void PyDescriptor::parseParameters(const ParametersMap & parameters)
std::string previousPath = path_; std::string previousPath = path_;
Parameters::parse(parameters, Parameters::kPyDescriptorPath(), path_); Parameters::parse(parameters, Parameters::kPyDescriptorPath(), path_);
Parameters::parse(parameters, Parameters::kPyDescriptorDim(), dim_); Parameters::parse(parameters, Parameters::kPyDescriptorDim(), dim_);
path_ = uReplaceChar(path_, '~', UDirectory::homeDir()); if(!path_.empty() && path_[0] == '~' && (path_.size() == 1 || path_[1] == '/' || path_[1] == '\\'))
{
path_ = UDirectory::homeDir() + path_.substr(1);
}
UINFO("path = %s", path_.c_str()); UINFO("path = %s", path_.c_str());
UINFO("dim = %d", dim_); UINFO("dim = %d", dim_);
UTimer timer; UTimer timer;
+4 -1
View File
@@ -88,7 +88,10 @@ void PyDetector::parseParameters(const ParametersMap & parameters)
Parameters::parse(parameters, Parameters::kPyDetectorPath(), path_); Parameters::parse(parameters, Parameters::kPyDetectorPath(), path_);
Parameters::parse(parameters, Parameters::kPyDetectorCuda(), cuda_); Parameters::parse(parameters, Parameters::kPyDetectorCuda(), cuda_);
path_ = uReplaceChar(path_, '~', UDirectory::homeDir()); if(!path_.empty() && path_[0] == '~' && (path_.size() == 1 || path_[1] == '/' || path_[1] == '\\'))
{
path_ = UDirectory::homeDir() + path_.substr(1);
}
} }
std::vector<cv::KeyPoint> PyDetector::generateKeypointsImpl(const cv::Mat & image, const cv::Rect & roi, const cv::Mat & mask) std::vector<cv::KeyPoint> PyDetector::generateKeypointsImpl(const cv::Mat & image, const cv::Rect & roi, const cv::Mat & mask)
+7 -2
View File
@@ -31,8 +31,13 @@ PyMatcher::PyMatcher(
cuda_(cuda) cuda_(cuda)
{ {
PythonInterface::instance("PyMatcher"); PythonInterface::instance("PyMatcher");
path_ = uReplaceChar(pythonMatcherPath, '~', UDirectory::homeDir()); auto expandTilde = [](const std::string & p) -> std::string {
model_ = uReplaceChar(model, '~', UDirectory::homeDir()); if(!p.empty() && p[0] == '~' && (p.size() == 1 || p[1] == '/' || p[1] == '\\'))
return UDirectory::homeDir() + p.substr(1);
return p;
};
path_ = expandTilde(pythonMatcherPath);
model_ = expandTilde(model);
UINFO("path = %s", path_.c_str()); UINFO("path = %s", path_.c_str());
UINFO("model = %s", model_.c_str()); UINFO("model = %s", model_.c_str());