83dc25dbc8b4ed98b4cc952e3cb35668e5a65490,dataloader.py,ToTensor,__call__,#ToTensor#Any#,120
Before Change
// numpy image: H x W x C
// torch image: C X H X W
image = image.transpose((2, 0, 1))
return {"img": torch.from_numpy(image),
"annot": torch.from_numpy(annots)}
class Resizer(object):
Convert ndarrays in sample to Tensors.
After Change
image, annots = sample["img"], sample["annot"]
return {"img":((image.astype(np.float32)-self.mean)/self.std), "annot": annots}
class UnNormalizer(object):
def __init__(self, mean=None, std=None):
if mean == None:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: yhenon/pytorch-retinanet
Commit Name: 83dc25dbc8b4ed98b4cc952e3cb35668e5a65490
Time: 2018-06-12
Author: yannhenon@gmail.com
File Name: dataloader.py
Class Name: ToTensor
Method Name: __call__
Project Name: scipy/scipy
Commit Name: 0131d72f0f7a5c13f00961aea054094b2b78f071
Time: 2016-10-12
Author: evgeny.burovskiy@gmail.com
File Name: scipy/interpolate/fitpack.py
Class Name:
Method Name: splev
Project Name: dpressel/mead-baseline
Commit Name: 348b4a63399972a0276d4a7d2beb0cdf191da5d4
Time: 2018-09-30
Author: dpressel@gmail.com
File Name: python/baseline/dy/lm/model.py
Class Name: CharCompLanguageModel
Method Name: make_input