MCPcopy Create free account
hub / github.com/modelscope/modelscope / __call__

Method __call__

tests/msdatasets/test_ms_dataset.py:27–37  ·  view source on GitHub ↗
(self, data)

Source from the content-addressed store, hash-verified

25 self.height = kwargs.pop('height', 'width')
26
27 def __call__(self, data):
28 import cv2
29 image_path = data.get(self.path_field)
30 if not image_path:
31 return None
32 img = cv2.imread(image_path)
33 return {
34 'image':
35 cv2.resize(img,
36 (data.get(self.height, 128), data.get(self.width, 128)))
37 }
38
39
40class GenLocalFile:

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected