Browse Source

update preprocess data

tags/v0.7.0-beta
hanjun996 5 years ago
parent
commit
6339d6f00a
1 changed files with 8 additions and 7 deletions
  1. +8
    -7
      model_zoo/official/cv/ssd/src/dataset.py

+ 8
- 7
model_zoo/official/cv/ssd/src/dataset.py View File

@@ -233,13 +233,14 @@ def create_voc_label(is_training):
'id': img_id}
json_dict['images'].append(image)

for cls_name, cid in cls_map.items():
cat = {'supercategory': 'none', 'id': cid, 'name': cls_name}
json_dict['categories'].append(cat)
json_fp = open(json_file, 'w')
json_str = json.dumps(json_dict)
json_fp.write(json_str)
json_fp.close()
if not is_training:
for cls_name, cid in cls_map.items():
cat = {'supercategory': 'none', 'id': cid, 'name': cls_name}
json_dict['categories'].append(cat)
json_fp = open(json_file, 'w')
json_str = json.dumps(json_dict)
json_fp.write(json_str)
json_fp.close()

return images, image_files_dict, image_anno_dict



Loading…
Cancel
Save