Created
June 2, 2021 19:18
-
-
Save sgl0v/be0ac3587d7df58b161bbc44538c0404 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
colorizer_coreml = ct.models.MLModel('coremlColorizer.mlmodel') # ➊ | |
img = load_img(opt.img_path) | |
(tens_l_orig, tens_l_rs) = preprocess_img(img, HW=(256,256)) # ➋ | |
tens_ab_rs = colorizer_coreml.predict({'input1': tens_l_rs.numpy()})['796'] # ➌ | |
# ➍ | |
img_bw = postprocess_tens(tens_l_orig, torch.cat((0*tens_l_orig,0*tens_l_orig),dim=1)) | |
out_img_coreml = postprocess_tens(tens_l_orig, torch.from_numpy(tens_ab_rs)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment