@@ -32,6 +32,7 @@ class CreateMLWriter:
|
||||
|
||||
output_image_dict = {
|
||||
"image": self.filename,
|
||||
"verified": self.verified,
|
||||
"annotations": []
|
||||
}
|
||||
|
||||
@@ -107,12 +108,15 @@ class CreateMLReader:
|
||||
with open(self.json_path, "r") as file:
|
||||
input_data = file.read()
|
||||
|
||||
output_dict = json.loads(input_data)
|
||||
self.verified = True
|
||||
# Returns a list
|
||||
output_list = json.loads(input_data)
|
||||
|
||||
if output_list:
|
||||
self.verified = output_list[0].get("verified", False)
|
||||
|
||||
if len(self.shapes) > 0:
|
||||
self.shapes = []
|
||||
for image in output_dict:
|
||||
for image in output_list:
|
||||
if image["image"] == self.filename:
|
||||
for shape in image["annotations"]:
|
||||
self.add_shape(shape["label"], shape["coordinates"])
|
||||
|
||||
@@ -48,6 +48,7 @@ class LabelFile(object):
|
||||
image_shape, shapes, filename, local_img_path=image_path)
|
||||
writer.verified = self.verified
|
||||
writer.write()
|
||||
return
|
||||
|
||||
|
||||
def save_pascal_voc_format(self, filename, shapes, image_path, image_data,
|
||||
|
||||
Reference in New Issue
Block a user