From b52645c3a6c88c45668c68796d1dead75fd99ae1 Mon Sep 17 00:00:00 2001 From: jario Date: Sat, 27 Jan 2024 11:07:42 +0800 Subject: [PATCH 1/3] fix --- algorithm/sv_algorithm_base.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/algorithm/sv_algorithm_base.cpp b/algorithm/sv_algorithm_base.cpp index d94a336..0f23509 100644 --- a/algorithm/sv_algorithm_base.cpp +++ b/algorithm/sv_algorithm_base.cpp @@ -32,7 +32,7 @@ CameraAlgorithm::CameraAlgorithm() // this->_allocator = NULL; this->_t0 = std::chrono::system_clock::now(); - this->alg_params_fn = _get_home() + SV_ROOT_DIR + "params/a-params/sv_algorithm_params.json"; + this->alg_params_fn = _get_home() + SV_ROOT_DIR + "confs/sv_algorithm_params.json"; // std::cout << "CameraAlgorithm->alg_params_fn: " << this->alg_params_fn << std::endl; // if (_is_file_exist(params_fn)) // this->loadAlgorithmParams(params_fn); From 29702bfd1173a986a98571e9bff49a0d586fcceb Mon Sep 17 00:00:00 2001 From: jario Date: Fri, 2 Feb 2024 23:16:49 +0800 Subject: [PATCH 2/3] fix camera cannot open continuously --- video_io/sv_video_base.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/video_io/sv_video_base.cpp b/video_io/sv_video_base.cpp index 168e358..60fdfa1 100644 --- a/video_io/sv_video_base.cpp +++ b/video_io/sv_video_base.cpp @@ -1173,6 +1173,7 @@ void CameraBase::openImpl() } void CameraBase::open(CameraType type, int id) { + this->release(); this->_type = type; this->_camera_id = id; @@ -1215,7 +1216,7 @@ bool CameraBase::read(cv::Mat& image) this->_is_updated = false; break; } - std::this_thread::sleep_for(std::chrono::milliseconds(20)); + std::this_thread::sleep_for(std::chrono::milliseconds(2)); n_try ++; } } @@ -1227,7 +1228,10 @@ bool CameraBase::read(cv::Mat& image) } void CameraBase::release() { - _cap.release(); + this->_is_running = false; + this->_is_updated = false; + if (this->_cap.isOpened()) + this->_cap.release(); } From f346ad49d99a0afda369f75aa4b6996785532d16 Mon Sep 17 00:00:00 2001 From: jario Date: Fri, 2 Feb 2024 23:26:16 +0800 Subject: [PATCH 3/3] fix model_sync --- scripts/model_sync.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/model_sync.py b/scripts/model_sync.py index 6967ee0..fd744c1 100644 --- a/scripts/model_sync.py +++ b/scripts/model_sync.py @@ -9,6 +9,8 @@ root_url = "https://download.amovlab.com/model/SpireCV-models/" model_list_url = root_url + "model-list.txt" root_path = os.path.expanduser("~") + "/SpireCV/models" print("MODEL PATH:", root_path) +if not os.path.exists(root_path): + os.makedirs(root_path) list_file = os.path.join(root_path, "model-list.txt")