1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Merge pull request #26486 from gursimarsingh:object_detection_engine_update

Code Fixes and changed post processing based on models.yml in Object Detection Sample #26486

## Major Changes

1. Changes to add findModel support for config file in models like yolov4, yolov4-tiny, yolov3, ssd_caffe, tiny-yolo-voc, ssd_tf and faster_rcnn_tf.
2. Added new model and config download links for ssd_caffe, as previous links were not working.
3. Switched to DNN ENGINE_CLASSIC for non-cpu convig as new engine does not support it.
4. Fixes in python sample related to yolov5 usage.

### 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
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
Gursimar Singh
2024-12-02 11:35:25 +05:30
committed by GitHub
parent b476ed6d06
commit efbe580ff3
5 changed files with 110 additions and 74 deletions
+6 -1
View File
@@ -19,7 +19,10 @@ def add_argument(zoo, parser, name, help, required=False, default=None, type=Non
if "sha1" in name:
prefix = name.replace("sha1", "")
value = node.getNode(prefix + "load_info")
value = value.getNode(name)
if prefix == "config_":
value = value.getNode("sha1")
else:
value = value.getNode(name)
if "download_sha" in name:
prefix = name.replace("download_sha", "")
value = node.getNode(prefix + "load_info")
@@ -97,6 +100,8 @@ def add_preproc_args(zoo, parser, sample, alias=None, prefix=""):
help='An index of background class in predictions. If not negative, exclude such class from list of classes.', alias=alias)
add_argument(zoo, parser, prefix+'sha1', type=str,
help='Optional path to hashsum of downloaded model to be loaded from models.yml', alias=alias)
add_argument(zoo, parser, prefix+'config_sha1', type=str,
help='Optional path to hashsum of downloaded config to be loaded from models.yml', alias=alias)
add_argument(zoo, parser, prefix+'download_sha', type=str,
help='Optional path to hashsum of downloaded model to be loaded from models.yml', alias=alias)