Эх сурвалжийг харах

Fix not imageData property

granbestiapop 5 жил өмнө
parent
commit
e1fdeda94e

+ 2 - 3
labelme/cli/json_to_dataset.py

@@ -32,10 +32,9 @@ def main():
         os.mkdir(out_dir)
 
     data = json.load(open(json_file))
+    imageData = data.get('imageData')
 
-    if data['imageData']:
-        imageData = data['imageData']
-    else:
+    if not imageData:
         imagePath = os.path.join(os.path.dirname(json_file), data['imagePath'])
         with open(imagePath, 'rb') as f:
             imageData = f.read()