MCPcopy Create free account
hub / github.com/RozDavid/UnScene3D / load_image

Function load_image

utils/utils.py:202–209  ·  view source on GitHub ↗
(path, scale=1.)

Source from the content-addressed store, hash-verified

200
201
202def load_image(path, scale=1.):
203 image = Image.open(path)
204 if scale != 1.:
205 width, height = image.size
206 target_shape = (int(width * scale), int(height * scale))
207 image = image.resize(target_shape, Image.NEAREST)
208
209 return np.array(image)
210
211def precision_at_one(pred, target, ignore_label=255):
212 """Computes the precision@k for the specified values of k"""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected