pytorch/vision

transforms.ToTensor() for numpy float array in the range of [0.0, 255.0]

Open

#546 创建于 2018年7月13日

在 GitHub 查看
 (6 评论) (4 反应) (0 负责人)Python (6,858 fork)batch import
enhancementhelp wantedmodule: transforms

仓库指标

Star
 (15,050 star)
PR 合并指标
 (平均合并 12天 8小时) (30 天内合并 14 个 PR)

描述

I had come across a debugging scenario where the ToTensor() didn't convert the numpy float array in the range of [0.0, 255.0] to the range [0.0 to 1.0] due to following lines: https://github.com/pytorch/vision/blob/master/torchvision/transforms/functional.py#L50-L53

Basically, this API assumes that all the float arrays will already be in range [0.0 to 1.0]. Do you think we have to change this behavior?

贡献者指南