You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In yolov4-inference-demo.py, it assumes the height and width of the image are equal.
How should I change the code to perform inference on image that is not square?
The figure below shows the part that throws error when doing inference with rectangular image.
It defines idx based on int(resized_image_w/out_blob_w) and int(resized_image_h/out_blob_h), which are equal.
How should I change this part when, for example image size is 1080x1920?
The text was updated successfully, but these errors were encountered:
yankee624
changed the title
How to run with image that is not square-shaped?
How to run inference with image that is not square-shaped?
Jun 6, 2021
@yankee624
Your screenshot is the inference program of scaled-yolov4.
see FAQ #10 num 4
Just change the input size of tfmodel ,test with inference demo to see if the demo could Identify model‘s input size
@TNTWEN
Yes I am actually talking about the inference program.
I checked the FAQ and changed the input size of the model.
But, when doing the inference with the changed model, the postprocessing part (in the above screenshot) becomes the problem.
It seems to modify the width and height somehow (maybe because the original width and height output from the model aren't the real width and height), but I can't understand what it's doing.
So I don't know how to change that postprocessing part if I use non-square input images
In
yolov4-inference-demo.py
, it assumes the height and width of the image are equal.How should I change the code to perform inference on image that is not square?
The figure below shows the part that throws error when doing inference with rectangular image.
It defines
idx
based onint(resized_image_w/out_blob_w)
andint(resized_image_h/out_blob_h)
, which are equal.How should I change this part when, for example image size is 1080x1920?
The text was updated successfully, but these errors were encountered: