首页 > 解决方案 > TensorFlow 图像太小而无法正确显示结果

问题描述

我是否可以通过调整大小或更改对象检测结果的显示方式?

这是我目前的结果

任何帮助将不胜感激!

标签: tensorflow2.0object-detectionobject-detection-api

解决方案


我认为从您的问题来看,您是在问如何对图像进行上采样。有几种方法,我认为最简单的方法是使用 Pillow,请参见此处:https ://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.resize

from PIL import Image

im = Image.open("hopper.jpg")

# Provide the target width and height of the image
(width, height) = (im.width * 2, im.height * 2)
im_resized = im.resize((width, height))

推荐阅读