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

[Bug]: openvino_inferencer.py line 204 cv2.resize error #2361

Open
1 task done
HBing110 opened this issue Oct 12, 2024 · 0 comments
Open
1 task done

[Bug]: openvino_inferencer.py line 204 cv2.resize error #2361

HBing110 opened this issue Oct 12, 2024 · 0 comments

Comments

@HBing110
Copy link

HBing110 commented Oct 12, 2024

Describe the bug

openvino_inferencer.py

line 204

tuple(list(self.input_blob.partial_shape)[2:][::-1]) type:(<Dimension: 256>, <Dimension: 256>)
should input type: [256, 256]

Dataset

N/A

Model

PatchCore

Steps to reproduce the behavior

python tools/inference/openvino_inference.py

OS information

OS information:

  • windows 10

Expected behavior

        rDsize = self.input_blob.partial_shape[2:][::-1]
        image = cv2.resize(image, [dim.max_length for dim in rDsize])

Screenshots

No response

Pip/GitHub

pip

What version/branch did you use?

No response

Configuration YAML

Patchcore YAML

Logs

Backend tkagg is interactive backend. Turning interactive mode on.
Traceback (most recent call last):
  File "C:\Users\huangbing\AppData\Roaming\JetBrains\IdeaIC2024.2\plugins\python-ce\helpers\pydev\pydevd.py", line 1570, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "C:\Users\huangbing\AppData\Roaming\JetBrains\IdeaIC2024.2\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "G:\study\anomalib-main\openvino_infer.py", line 100, in <module>
    infer(args)
  File "G:\study\anomalib-main\openvino_infer.py", line 82, in infer
    predictions = inferencer.predict(image=image)
  File "G:\study\anomalib-main\src\anomalib\deploy\inferencers\openvino_inferencer.py", line 204, in predict
    image = cv2.resize(image, tuple(list(self.input_blob.partial_shape)[2:][::-1]))
cv2.error: OpenCV(4.10.0) :-1: error: (-5:Bad argument) in function 'resize'

Code of Conduct

  • I agree to follow this project's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant