Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved classification sample #25519

Open
wants to merge 18 commits into
base: 5.x
Choose a base branch
from

Conversation

gursimarsingh
Copy link

#25006 #25314

This pull requests replaces the caffe model for classification with onnx versions. It also adds resnet in model.yml.

Pull Request Readiness Checklist

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

  • I agree to contribute to the project under Apache 2 License.
  • 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

@gursimarsingh gursimarsingh self-assigned this May 1, 2024
@gursimarsingh gursimarsingh added category: samples cleanup Code cleanup (e.g, drop legacy C-API, legacy unmaintained code) OpenCV5 labels May 1, 2024
@gursimarsingh gursimarsingh added this to the 5.0 milestone May 1, 2024
samples/dnn/models.yml Outdated Show resolved Hide resolved
"{ backend | default | Choose one of computation backends: "
"default: automatically (by default), "
"inference_engine: Intel's Deep Learning Inference Engine (https://software.intel.com/openvino-toolkit), "
"openvino: OpenCV implementation, "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's wrong line.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed @asmorkalov

if (parser.has("input")) {
string input = parser.get<String>("input");

if (input.find('.')==string::npos) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be network stream. I propose always use VideoCapture. It supports sequence of images too.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asmorkalov
VideoCapture does support sequences of images, but it expects them to be in a numerically ordered format (e.g., image1.jpg, image2.jpg). It cannot handle images with unordered prefixes (e.g., ab.jpg, bc.jpg, xyz.jpg). For cases where images are not named in a numerical sequence, this was implemented to read and process these images from a directory.

Comment on lines 15 to 20
{"default", 0},
{"inference_engine", 1},
{"openvino", 2},
{"vkcom", 3},
{"cuda", 4},
{"webnn", 5}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not OpenCV constants?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated @asmorkalov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: samples cleanup Code cleanup (e.g, drop legacy C-API, legacy unmaintained code) OpenCV5
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

None yet

4 participants