!4824 update voc preprocess data

Merge pull request !4824 from hanjun996/master
pull/4824/MERGE
mindspore-ci-bot 5 years ago committed by Gitee
commit 51d92b1183

@ -233,13 +233,14 @@ def create_voc_label(is_training):
'id': img_id} 'id': img_id}
json_dict['images'].append(image) json_dict['images'].append(image)
for cls_name, cid in cls_map.items(): if not is_training:
cat = {'supercategory': 'none', 'id': cid, 'name': cls_name} for cls_name, cid in cls_map.items():
json_dict['categories'].append(cat) cat = {'supercategory': 'none', 'id': cid, 'name': cls_name}
json_fp = open(json_file, 'w') json_dict['categories'].append(cat)
json_str = json.dumps(json_dict) json_fp = open(json_file, 'w')
json_fp.write(json_str) json_str = json.dumps(json_dict)
json_fp.close() json_fp.write(json_str)
json_fp.close()
return images, image_files_dict, image_anno_dict return images, image_files_dict, image_anno_dict

Loading…
Cancel
Save