MCPcopy Create free account
hub / github.com/aigc3d/LHM / get_image

Method get_image

engine/SegmentAPI/base.py:157–167  ·  view source on GitHub ↗
(self, input, type_mode, order)

Source from the content-addressed store, hash-verified

155 self.type_mode = type_mode
156
157 def get_image(self, input, type_mode, order):
158 if isinstance(input, Image):
159 return input.to_numpy(type_mode, order)
160 elif isinstance(input, np.ndarray):
161 self.data = input
162 self.order = "RGB" # default
163 self.type_mode = get_dtype_string(input)
164
165 return self.to_numpy(type_mode, order)
166 else:
167 raise NotImplementedError
168
169 def to_numpy(self, type_mode="uint8", order="RGB"):
170

Callers 1

__init__Method · 0.95

Calls 2

to_numpyMethod · 0.95
get_dtype_stringFunction · 0.85

Tested by

no test coverage detected