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
+4 -2
View File
@@ -425,6 +425,8 @@ class FuncInfo(GeneralInfo):
arg_fix_map = func_fix_map.get(arg[1], {})
arg[0] = arg_fix_map.get('ctype', arg[0]) #fixing arg type
arg[3] = arg_fix_map.get('attrib', arg[3]) #fixing arg attrib
if arg[0] == 'dnn_Net':
arg[0] = 'Net'
self.args.append(ArgInfo(arg))
def fullClassJAVA(self):
@@ -474,7 +476,7 @@ class JavaWrapperGenerator(object):
jni_name = "(*("+classinfo.fullNameCPP()+"*)%(n)s_nativeObj)"
type_dict.setdefault(name, {}).update(
{ "j_type" : classinfo.jname,
"jn_type" : "long", "jn_args" : (("__int64", ".nativeObj"),),
"jn_type" : "long", "jn_args" : (("__int64", ".getNativeObjAddr()"),),
"jni_name" : jni_name,
"jni_type" : "jlong",
"suffix" : "J",
@@ -483,7 +485,7 @@ class JavaWrapperGenerator(object):
)
type_dict.setdefault(name+'*', {}).update(
{ "j_type" : classinfo.jname,
"jn_type" : "long", "jn_args" : (("__int64", ".nativeObj"),),
"jn_type" : "long", "jn_args" : (("__int64", ".getNativeObjAddr()"),),
"jni_name" : "&("+jni_name+")",
"jni_type" : "jlong",
"suffix" : "J",