From 239ae0f67102b1b6e1c8158117b3d0d67eddab5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=9D=E7=8B=84=E5=A8=81=E5=B0=94?= <751387081@qq.com> Date: Mon, 26 Sep 2022 08:11:26 +0000 Subject: [PATCH] =?UTF-8?q?update=20AnimeGAN/eval.py.=20=E4=BD=BF=E7=94=A8?= =?UTF-8?q?if=E6=9B=BF=E4=BB=A3assert=EF=BC=8C=E5=B9=B6=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 贝狄威尔 <751387081@qq.com> --- AnimeGAN/eval.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/AnimeGAN/eval.py b/AnimeGAN/eval.py index 77e87d8..a0c41c2 100644 --- a/AnimeGAN/eval.py +++ b/AnimeGAN/eval.py @@ -36,7 +36,13 @@ def eval_metrics(gpu_path, npu_path): # should ensure the files'order keeping the same as before. gpu_imgs = sorted(glob.glob(os.path.join(gpu_path, '*.jpg'))) npu_imgs = sorted(glob.glob(os.path.join(npu_path, '*.jpg'))) - assert len(gpu_imgs) == len(npu_imgs) + if len(gpu_imgs) != len(npu_imgs): + print("The number of pictures in the two folders does not match!Please check it.") + print('It may be caused by:') + print(" 1.The outputPath dir not being empty before running main.py.") + print(" 2.Comparing with wrong gpu dir.") + print(" 3.Some pictures not being processed successfully in npu.") + exit() for index, img1_path in enumerate(gpu_imgs): img1 = cv2.imread(img1_path)