Datasets:
fix: change json format
Browse files- visible-watermark-pita.py +16 -16
visible-watermark-pita.py
CHANGED
@@ -99,19 +99,19 @@ class WatermarkPita(datasets.GeneratorBasedBuilder):
|
|
99 |
with open(label_path, "r") as f:
|
100 |
bboxes = json.load(f)
|
101 |
|
102 |
-
print(bboxes)
|
103 |
-
|
104 |
-
objects = []
|
105 |
-
for bbox in bboxes:
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
yield idx, {"image": image_path, "objects":
|
|
|
99 |
with open(label_path, "r") as f:
|
100 |
bboxes = json.load(f)
|
101 |
|
102 |
+
# print(bboxes)
|
103 |
+
|
104 |
+
# objects = []
|
105 |
+
# for bbox in bboxes:
|
106 |
+
# objects.append(
|
107 |
+
# {
|
108 |
+
# "x": bbox["x"],
|
109 |
+
# "y": bbox["y"],
|
110 |
+
# "w": bbox["width"],
|
111 |
+
# "h": bbox["height"],
|
112 |
+
# "label": bbox["label"],
|
113 |
+
# }
|
114 |
+
# )
|
115 |
+
# objects.append(bbox)
|
116 |
+
|
117 |
+
yield idx, {"image": image_path, "objects": bboxes}
|