From ae81b6c10ab0dfbdddad8534b889597391c2fbbe Mon Sep 17 00:00:00 2001 From: Wesley Williams Date: Wed, 14 Mar 2018 02:19:51 +0000 Subject: [PATCH] Only import smooth_filter if needed, allows running without cupy --- process_stylization.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/process_stylization.py b/process_stylization.py index c4ecd09..7e2b97c 100644 --- a/process_stylization.py +++ b/process_stylization.py @@ -14,7 +14,6 @@ import torchvision.utils as utils from photo_smooth import Propagator -from smooth_filter import smooth_filter # Load Propagator p_pro = Propagator() @@ -70,6 +69,7 @@ def stylization(p_wct, content_image_path, style_image_path, content_seg_path, s print("NotImplemented: The CPU version of smooth filter has not been implemented currently.") return + from smooth_filter import smooth_filter with Timer("Elapsed time in post processing: %f"): out_img = smooth_filter(output_image_path, content_image_path, f_radius=15, f_edge=1e-1) out_img.save(output_image_path)