prepro.py 文件源码

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

项目:Image-Captioning 作者: zsdonghao 项目源码 文件源码
def brightness_multi(x, gamma=1, gain=1, is_random=False):
    """Change the brightness of multiply images, randomly or non-randomly.
    Usually be used for image segmentation which x=[X, Y], X and Y should be matched.

    Parameters
    -----------
    x : list of numpy array
        List of images with dimension of [n_images, row, col, channel] (default).
    others : see ``brightness``.
    """
    if is_random:
        gamma = np.random.uniform(1-gamma, 1+gamma)

    results = []
    for data in x:
        results.append( exposure.adjust_gamma(data, gamma, gain) )
    return np.asarray(results)


# contrast
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号