preprocessing.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:pycolor_detection 作者: parth1993 项目源码 文件源码
def resizing(img):
    height, width, channels = img.shape
    if max(height, width) > 100:
        ratio = float(height) / width
        new_width = 100 / ratio
        img_resized = cv2.resize(img, (int(new_width), 100))
        ip_convert = cv2.imencode('.png', img_resized)
    else:
        ip_convert = cv2.imencode('.png', img)

    return ip_convert
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号