如何在喀拉拉邦按比例缩小图像金字塔的图像? [英] How to down scale image in keras for an image pyramid?

查看:85
本文介绍了如何在喀拉拉邦按比例缩小图像金字塔的图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在深度多尺度去模糊中使用图像金字塔进行深度学习.使用keras时如何动态缩小图像?

I'd like to use an image pyramid for deep learning as in Deep Multi-scale for Deblurring. How can I down scale images on the fly when using keras?

推荐答案

如果降比例是整数,则可以使用平均池化"层.

You could use an Average Pooling layer if the downscale rate is an integer.

o = AveragePooling2D(pooling_size=(2, 2))(i)

这会将2x2的窗口平均为一个像素,这是将图像大小调整2倍的相当准确的方法.

This will average a 2x2 window into a single pixel, which is a fairly accurate way of resizing an image by a factor of 2.

这篇关于如何在喀拉拉邦按比例缩小图像金字塔的图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆