MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / __call__

Method __call__

data/transforms.py:126–149  ·  view source on GitHub ↗
(self, img, img_num=1)

Source from the content-addressed store, hash-verified

124 self.normalize_transform = transforms.Normalize(mean=image_mean, std=image_std, inplace=True)
125
126 def __call__(self, img, img_num=1):
127
128 image = convert_to_rgb(img)
129 image = to_numpy_array(image)
130 image = resize(
131 image,
132 size=(448, 448),
133 resample=3
134 )
135 # image = self.rescale(image=image, scale= 0.00392156862745098, input_data_format=input_data_format)
136 # image = self.normalize(
137 # image=image,
138 # mean=image_mean,
139 # std=image_std,
140 # input_data_format=input_data_format,
141 # )
142 # return image
143 # img = img.permute(2, 0, 1)
144 # print('image numpy', image.shape)
145 img = self.to_tensor_transform(image)
146 # img = img.permute(2, 0, 1)
147 # print('img', img.shape)
148 img = self.normalize_transform(img)
149 return img
150
151class QwenVL2ImageTransform:
152 def __init__(

Callers

nothing calls this directly

Calls 1

resizeFunction · 0.85

Tested by

no test coverage detected