Spaces:
Paused
Paused
Update inference_propainter.py
Browse files- inference_propainter.py +4 -4
inference_propainter.py
CHANGED
@@ -212,12 +212,12 @@ if __name__ == '__main__':
|
|
212 |
parser.add_argument(
|
213 |
'--save_frames', action='store_true', help='Save output frames. Default: False')
|
214 |
parser.add_argument(
|
215 |
-
'--
|
216 |
|
217 |
args = parser.parse_args()
|
218 |
|
219 |
# Use fp16 precision during inference to reduce running memory cost
|
220 |
-
use_half = False
|
221 |
if device == torch.device('cpu'):
|
222 |
use_half = False
|
223 |
|
@@ -468,8 +468,8 @@ if __name__ == '__main__':
|
|
468 |
# save videos frame
|
469 |
masked_frame_for_save = [cv2.resize(f, out_size) for f in masked_frame_for_save]
|
470 |
comp_frames = [cv2.resize(f, out_size) for f in comp_frames]
|
471 |
-
imageio.mimwrite(os.path.join(save_root, 'masked_in.mp4'), masked_frame_for_save, fps=fps, quality=
|
472 |
-
imageio.mimwrite(os.path.join(save_root, 'inpaint_out.mp4'), comp_frames, fps=fps, quality=
|
473 |
|
474 |
print(f'\nAll results are saved in {save_root}')
|
475 |
|
|
|
212 |
parser.add_argument(
|
213 |
'--save_frames', action='store_true', help='Save output frames. Default: False')
|
214 |
parser.add_argument(
|
215 |
+
'--fp16', action='store_true', help='Use fp16 (half precision) during inference. Default: fp32 (single precision).')
|
216 |
|
217 |
args = parser.parse_args()
|
218 |
|
219 |
# Use fp16 precision during inference to reduce running memory cost
|
220 |
+
use_half = True if args.fp16 else False
|
221 |
if device == torch.device('cpu'):
|
222 |
use_half = False
|
223 |
|
|
|
468 |
# save videos frame
|
469 |
masked_frame_for_save = [cv2.resize(f, out_size) for f in masked_frame_for_save]
|
470 |
comp_frames = [cv2.resize(f, out_size) for f in comp_frames]
|
471 |
+
imageio.mimwrite(os.path.join(save_root, 'masked_in.mp4'), masked_frame_for_save, fps=fps, quality=7)
|
472 |
+
imageio.mimwrite(os.path.join(save_root, 'inpaint_out.mp4'), comp_frames, fps=fps, quality=7)
|
473 |
|
474 |
print(f'\nAll results are saved in {save_root}')
|
475 |
|