MCPcopy
hub / github.com/richzhang/colorization / load_img

Function load_img

colorizers/util.py:9–13  ·  view source on GitHub ↗
(img_path)

Source from the content-addressed store, hash-verified

7from IPython import embed
8
9def load_img(img_path):
10 out_np = np.asarray(Image.open(img_path))
11 if(out_np.ndim==2):
12 out_np = np.tile(out_np[:,:,None],3)
13 return out_np
14
15def resize_img(img, HW=(256,256), resample=3):
16 return np.asarray(Image.fromarray(img).resize((HW[1],HW[0]), resample=resample))

Callers 1

demo_release.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected