Fix minor bugs of multiple apps examples

This commit is contained in:
Timothyxxx
2024-01-31 19:40:41 +08:00
parent 96bfb12a3d
commit d65b6994d3
9 changed files with 13 additions and 70 deletions

View File

@@ -12,6 +12,8 @@ def compare_image_list(pred_img_path_list: Union[str, List[str]],
pred_img_path_list = [pred_img_path_list]
gold_img_path_list = [gold_img_path_list]
for pred_img_path, gold_img_path in zip(pred_img_path_list, gold_img_path_list):
if not pred_img_path or not gold_img_path:
return 0.0
pred_img = Image.open(pred_img_path)
gold_img = Image.open(gold_img_path)
diff = ImageChops.difference(pred_img, gold_img)