From f3d65241c5cf0a94d9650db9c80f55226f0195c0 Mon Sep 17 00:00:00 2001 From: raphael Date: Fri, 6 Aug 2021 13:34:46 +0200 Subject: [PATCH] fixes bug in logging function --- coco_gen.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/coco_gen.py b/coco_gen.py index bb473e1..a9729c0 100644 --- a/coco_gen.py +++ b/coco_gen.py @@ -4,14 +4,13 @@ import numpy as np from PIL import Image - no_label = 0 small = 0 passed = 0 - count = 0 + print("loading coco annotations...") coco = json.load(open('./coco/annotations/instances_val2014.json')) print("done") @@ -36,6 +35,7 @@ def show(pil, pause=0.2): def parseImage(coImg): + global no_label, small, passed, coco # open image file path = "coco/val2014/" + coImg['file_name'] @@ -62,13 +62,14 @@ def parseImage(coImg): passed += 1 if __name__ == "__main__": + for coImg in coco['images']: parseImage(coImg) count += 1 if count % 100 == 0: print("status:") print(f"no labels: {no_label}") - print(f"to small: {small") + print(f"to small: {small}") print(f"passed: {passed}") print("-----")