From 572d4824ae4204d92c142f3aff6defebd3b08887 Mon Sep 17 00:00:00 2001 From: Sreerag M Date: Thu, 3 Jun 2021 08:37:00 +0530 Subject: [PATCH 1/2] Correct variable name conflict --- run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run.py b/run.py index 2ce83b9..72a14c9 100644 --- a/run.py +++ b/run.py @@ -26,7 +26,7 @@ i = 0 -filename = "" +fileName = "" print('Input file:',fileName) mat_img = cv2.imread(fileName) From f7d455ea7ffdcf656acb289b3300aa480574bee0 Mon Sep 17 00:00:00 2001 From: Sreerag M Date: Thu, 3 Jun 2021 08:48:19 +0530 Subject: [PATCH 2/2] Change path logic --- run.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/run.py b/run.py index 72a14c9..fd56921 100644 --- a/run.py +++ b/run.py @@ -6,6 +6,7 @@ import glob from tqdm import tqdm import jittor as jt +from pathlib import Path jt.flags.use_cuda = 1 @@ -43,7 +44,7 @@ combine_model.predict_shadow(mat_img) -output_file = 'ori'+ filename[-3:] +'.jpg' +output_file = 'ori'+ Path(fileName).stem +'.jpg' print('Output file:',output_file) cv2.imwrite(output_file,cv2.cvtColor(combine_model.generated, cv2.COLOR_BGR2RGB)) i = i + 1