display filename on image size mismatch
Summary: Pull Request resolved:
@@ -73,7 +73,13 @@ def check_image_size(dataset_dict, image):
expected_wh = (dataset_dict["width"], dataset_dict["height"])
if not image_wh == expected_wh:
raise SizeMismatchError(
- "mismatch (W,H), got {}, expect {}".format(image_wh, expected_wh)
+ "Mismatched (W,H){}, got {}, expect {}".format(
+ " for image " + dataset_dict["file_name"]
+ if "file_name" in dataset_dict
+ else "",
+ image_wh,
+ expected_wh,
+ )
)
# To ensure bbox always remap to original image size
