MCPcopy Create free account
hub / github.com/buaacxf/VIPTR / __call__

Method __call__

dataload/loader.py:82–97  ·  view source on GitHub ↗
(self, img)

Source from the content-addressed store, hash-verified

80 self.types = types
81 self.height = height
82 def __call__(self, img):
83 if (self.types == 'train' or self.types == 'val'):
84 w, h = img.size
85 img = img.resize((int(self.height / float(h) * w), self.height), Image.BILINEAR)
86 w, h = img.size
87 if (w < self.max_width):
88 img = Add_Padding(img, 0, 0, 0, self.max_width - w)
89 img = Image.fromarray(img)
90 else:
91 img = img.resize((self.max_width, self.height), Image.BILINEAR)
92 elif self.types == 'test':
93 w, h = img.size
94 img = img.resize((int(self.height / float(h) * w)//4*4, self.height), Image.BILINEAR)
95 img = self.toTensor(img)
96 img.sub_(0.5).div_(0.5)
97 return img
98
99class alignCollate(object):
100 def __init__(self, config,trans_type):

Callers

nothing calls this directly

Calls 1

Add_PaddingFunction · 0.85

Tested by

no test coverage detected