AItool commited on
Commit
06cbb3c
Β·
verified Β·
1 Parent(s): 42cbb25

Update inference_img.py

Browse files
Files changed (1) hide show
  1. inference_img.py +7 -3
inference_img.py CHANGED
@@ -28,13 +28,13 @@ try:
28
  model = Model()
29
  model.load_model(args.modelDir, -1)
30
  print("Loaded RIFE_HDv3 model.")
31
- print("Checkpoint reached!")
32
  except:
33
  from train_log.IFNet_HDv3 import Model
34
  model = Model()
35
  model.load_model(args.modelDir, -1)
36
  print("Loaded IFNet_HDv3 model.")
37
- print("Checkpoint reached!")
38
 
39
  model.eval()
40
  model.device()
@@ -95,7 +95,7 @@ else:
95
  if not os.path.exists('output'):
96
  os.mkdir('output')
97
 
98
- print("Checkpoint reached!")
99
 
100
  for i in range(len(img_list)):
101
  if args.img[0].endswith('.exr') and args.img[1].endswith('.exr'):
@@ -103,10 +103,14 @@ for i in range(len(img_list)):
103
  save_path = 'output/img{}.png'.format(i)
104
  success = cv2.imwrite(save_path, (img_list[i][0] * 255).byte().cpu().numpy().transpose(1, 2, 0)[:h, :w])
105
  print(f"Saving to {save_path} β†’ success: {success}")
 
 
106
  else:
107
  cv2.imwrite('output/img{}.png'.format(i), (img_list[i][0] * 255).byte().cpu().numpy().transpose(1, 2, 0)[:h, :w])
108
  save_path = 'output/img{}.png'.format(i)
109
  success = cv2.imwrite(save_path, (img_list[i][0] * 255).byte().cpu().numpy().transpose(1, 2, 0)[:h, :w])
110
  print(f"Saving to {save_path} β†’ success: {success}")
 
 
111
 
112
  print("Checkpoint reached!")
 
28
  model = Model()
29
  model.load_model(args.modelDir, -1)
30
  print("Loaded RIFE_HDv3 model.")
31
+ print("Checkpoint reached RIFE!")
32
  except:
33
  from train_log.IFNet_HDv3 import Model
34
  model = Model()
35
  model.load_model(args.modelDir, -1)
36
  print("Loaded IFNet_HDv3 model.")
37
+ print("Checkpoint reached IFNet!")
38
 
39
  model.eval()
40
  model.device()
 
95
  if not os.path.exists('output'):
96
  os.mkdir('output')
97
 
98
+ print("Checkpoint reached! output folder ok")
99
 
100
  for i in range(len(img_list)):
101
  if args.img[0].endswith('.exr') and args.img[1].endswith('.exr'):
 
103
  save_path = 'output/img{}.png'.format(i)
104
  success = cv2.imwrite(save_path, (img_list[i][0] * 255).byte().cpu().numpy().transpose(1, 2, 0)[:h, :w])
105
  print(f"Saving to {save_path} β†’ success: {success}")
106
+ print("Saving to:", os.path.abspath(save_path))
107
+
108
  else:
109
  cv2.imwrite('output/img{}.png'.format(i), (img_list[i][0] * 255).byte().cpu().numpy().transpose(1, 2, 0)[:h, :w])
110
  save_path = 'output/img{}.png'.format(i)
111
  success = cv2.imwrite(save_path, (img_list[i][0] * 255).byte().cpu().numpy().transpose(1, 2, 0)[:h, :w])
112
  print(f"Saving to {save_path} β†’ success: {success}")
113
+ print("Saving to:", os.path.abspath(save_path))
114
+
115
 
116
  print("Checkpoint reached!")