MCPcopy Create free account
hub / github.com/OpenGVLab/InternVL / forward

Method forward

classification/dataset/build.py:42–52  ·  view source on GitHub ↗
(self, img)

Source from the content-addressed store, hash-verified

40 self.scales = scales
41
42 def forward(self, img):
43 out = []
44 cc = transforms.CenterCrop(self.size)
45 for scale in self.scales:
46 size_ = int(scale * self.size)
47 rs = transforms.Resize(size_, interpolation=_pil_interp('bicubic'))
48 img_ = rs(img)
49 img_ = cc(img_)
50 out.append(img_)
51
52 return out
53
54 def __repr__(self) -> str:
55 return f'{self.__class__.__name__}(size={self.size}, scale={self.scales})'

Callers

nothing calls this directly

Calls 1

_pil_interpFunction · 0.85

Tested by

no test coverage detected