question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Resize bug in inference

See original GitHub issue
  • When input the width and height of the image are not equal, sizes of input arguments that do not match will occur

Line 152 in ./anomalib/deploy/inferencers/torch.py should be anomaly_map = cv2.resize(anomaly_map, (meta_data["image_shape"][1], meta_data["image_shape"][0]))

meta_data[“image_shape”] is (image_width, image_height)
-# cv2.resize(img, (image_height,image_width ),interpolation=cv2.INTER_CUBIC)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
djdamelncommented, Mar 8, 2022

@raviv https://github.com/openvinotoolkit/anomalib/pull/135 should solve the image_size problems for both training and inference for most models. Patchcore and GANomaly still do not allow changing the image size, but this will be addressed separately, see https://github.com/openvinotoolkit/anomalib/issues/136 and https://github.com/openvinotoolkit/anomalib/issues/40.

0reactions
samet-akcaycommented, Mar 9, 2022

@raviv PR #140 has now been merged, and the issue should be fixed. Feel free to re-open it if you think there is still an issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

The dangers behind image resizing - Zuru Tech
Usually, we resize the input of a machine learning model mainly because models train faster on smaller images. An input image that is...
Read more >
Floor - Cast - Resize(or Slice) cause internal error - TensorRT
Hi, NVIDIA guys. I'm facing internal error when using trtexec to convert onnx to engine. I provide a minimal test case to reproduce...
Read more >
Preprocessors — OpenVINO™ documentation — Version(latest)
Preprocessor is a class which processes input data before model inference. ... resize - resizing the image to a new width and height....
Read more >
[MS][LITE][resize]using package for cpu_gpu_ascend ... - Gitee
[MS][LITE][resize]using package for cpu_gpu_ascend, cbg_ai_ocr_detect_straight.pb inference failed. TODO. #I660IF Bug-Report.
Read more >
Resizing layer in Tensorflow crashes because of different ...
The error is that you cannot batch elements of different sizes. There's unfortunately no way around that. The documentation specifies that ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found