pytorch/vision

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

Open

#546 ouverte le 13 juil. 2018

Voir sur GitHub
 (6 commentaires) (4 réactions) (0 assignés)Python (6 858 forks)batch import
enhancementhelp wantedmodule: transforms

Métriques du dépôt

Stars
 (15 050 stars)
Métriques de merge PR
 (Merge moyen 12j 8h) (14 PRs mergées en 30 j)

Description

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?

Guide contributeur