1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge pull request #26875 from asmorkalov:as/in_memory_models

Added trackers factory with pre-loaded dnn models #26875

Replaces https://github.com/opencv/opencv/pull/26295

Allows to substitute custom models or initialize tracker from in-memory model.

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [ ] The PR is proposed to the proper branch
- [ ] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
Alexander Smorkalov
2025-02-14 15:35:38 +03:00
committed by GitHub
parent a8df0a06ac
commit ae25c3194f
9 changed files with 223 additions and 41 deletions
+9 -1
View File
@@ -24,11 +24,12 @@ class NewOpenCVTests(unittest.TestCase):
# path to local repository folder containing 'samples' folder
repoPath = None
extraTestDataPath = None
extraDnnTestDataPath = None
# github repository url
repoUrl = 'https://raw.github.com/opencv/opencv/4.x'
def find_file(self, filename, searchPaths=[], required=True):
searchPaths = searchPaths if searchPaths else [self.repoPath, self.extraTestDataPath]
searchPaths = searchPaths if searchPaths else [self.repoPath, self.extraTestDataPath, self.extraDnnTestDataPath]
for path in searchPaths:
if path is not None:
candidate = path + '/' + filename
@@ -83,10 +84,17 @@ class NewOpenCVTests(unittest.TestCase):
print("Testing OpenCV", cv.__version__)
print("Local repo path:", args.repo)
NewOpenCVTests.repoPath = args.repo
try:
NewOpenCVTests.extraTestDataPath = os.environ['OPENCV_TEST_DATA_PATH']
except KeyError:
print('Missing opencv extra repository. Some of tests may fail.')
try:
NewOpenCVTests.extraDnnTestDataPath = os.environ['OPENCV_DNN_TEST_DATA_PATH']
except KeyError:
pass
random.seed(0)
unit_argv = [sys.argv[0]] + other
unittest.main(argv=unit_argv)