Cartucho / mAP

mean Average Precision - This code evaluates the performance of your neural net for object recognition.
Apache License 2.0
2.93k stars 910 forks source link

Animation with big images #163

Open Bergschaf opened 2 years ago

Bergschaf commented 2 years ago

When the animation is displayed with very big images (higher resolution than the screen) only a fraction of the image is shown. I would suggest resizeing the image before it is displayed.

img = ResizeWithAspectRatio(img,height=1000)  # there are Libarys that can figure out the screensize
cv2.imshow("Animation", img)´´´

(line 662 - 663)

def ResizeWithAspectRatio(image, width=None, height=None, inter=cv2.INTER_AREA):
    dim = None
    (h, w) = image.shape[:2]
if width is None and height is None:
    return image
if width is None:
    r = height / float(h)
    dim = (int(w * r), height)
else:
    r = width / float(w)
    dim = (width, int(h * r))

return cv2.resize(image, dim, interpolation=inter)

https://stackoverflow.com/questions/35180764/opencv-python-image-too-big-to-display