|
@@ -22,13 +22,14 @@ def main():
|
|
|
|
|
|
data = json.load(open(json_file))
|
|
data = json.load(open(json_file))
|
|
|
|
|
|
- if data['imageData'] is not None:
|
|
|
|
|
|
+ if data['imageData']:
|
|
imageData = data['imageData']
|
|
imageData = data['imageData']
|
|
else:
|
|
else:
|
|
imagePath = os.path.join(os.path.dirname(json_file), data['imagePath'])
|
|
imagePath = os.path.join(os.path.dirname(json_file), data['imagePath'])
|
|
with open(imagePath, 'rb') as f:
|
|
with open(imagePath, 'rb') as f:
|
|
imageData = f.read()
|
|
imageData = f.read()
|
|
imageData = base64.b64encode(imageData).decode('utf-8')
|
|
imageData = base64.b64encode(imageData).decode('utf-8')
|
|
|
|
+
|
|
img = utils.img_b64_to_arr(imageData)
|
|
img = utils.img_b64_to_arr(imageData)
|
|
|
|
|
|
label_name_to_value = {'_background_': 0}
|
|
label_name_to_value = {'_background_': 0}
|