Spaces:
Sleeping
Sleeping
Update inference_img.py
Browse files- inference_img.py +11 -0
inference_img.py
CHANGED
@@ -100,7 +100,18 @@ import warnings
|
|
100 |
for i in range(len(img_list)):
|
101 |
if args.img[0].endswith('.exr') and args.img[1].endswith('.exr'):
|
102 |
cv2.imwrite('output/img{}.exr'.format(i), (img_list[i][0]).cpu().numpy().transpose(1, 2, 0)[:h, :w], [cv2.IMWRITE_EXR_TYPE, cv2.IMWRITE_EXR_TYPE_HALF])
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
else:
|
104 |
cv2.imwrite('output/img{}.png'.format(i), (img_list[i][0] * 255).byte().cpu().numpy().transpose(1, 2, 0)[:h, :w])
|
|
|
|
|
|
|
|
|
|
|
105 |
|
106 |
|
|
|
100 |
for i in range(len(img_list)):
|
101 |
if args.img[0].endswith('.exr') and args.img[1].endswith('.exr'):
|
102 |
cv2.imwrite('output/img{}.exr'.format(i), (img_list[i][0]).cpu().numpy().transpose(1, 2, 0)[:h, :w], [cv2.IMWRITE_EXR_TYPE, cv2.IMWRITE_EXR_TYPE_HALF])
|
103 |
+
|
104 |
+
# Replace this line (or add below your current cv2.imwrite)
|
105 |
+
save_path = 'output/img{}.png'.format(i)
|
106 |
+
success = cv2.imwrite(save_path, (img_list[i][0] * 255).byte().cpu().numpy().transpose(1, 2, 0)[:h, :w])
|
107 |
+
print(f"Saving to {save_path} → success: {success}")
|
108 |
+
|
109 |
else:
|
110 |
cv2.imwrite('output/img{}.png'.format(i), (img_list[i][0] * 255).byte().cpu().numpy().transpose(1, 2, 0)[:h, :w])
|
111 |
+
|
112 |
+
# Replace this line (or add below your current cv2.imwrite)
|
113 |
+
save_path = 'output/img{}.png'.format(i)
|
114 |
+
success = cv2.imwrite(save_path, (img_list[i][0] * 255).byte().cpu().numpy().transpose(1, 2, 0)[:h, :w])
|
115 |
+
print(f"Saving to {save_path} → success: {success}")
|
116 |
|
117 |
|