From 2df7b6e402d1b4dd4a6481afaf0ad7961609c8f1 Mon Sep 17 00:00:00 2001 From: tzutalin Date: Sun, 18 Nov 2018 09:28:38 -0800 Subject: [PATCH] Fix issue serializing qstring in pscal_voc_io.py --- libs/pascal_voc_io.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/pascal_voc_io.py b/libs/pascal_voc_io.py index 58a5b1e2..9930b666 100644 --- a/libs/pascal_voc_io.py +++ b/libs/pascal_voc_io.py @@ -6,6 +6,8 @@ from xml.etree.ElementTree import Element, SubElement from lxml import etree import codecs from libs.constants import DEFAULT_ENCODING +from libs.ustr import ustr + XML_EXT = '.xml' ENCODE_METHOD = DEFAULT_ENCODING @@ -85,8 +87,7 @@ class PascalVocWriter: for each_object in self.boxlist: object_item = SubElement(top, 'object') name = SubElement(object_item, 'name') - print (each_object['name']) - name.text = each_object['name'] + name.text = ustr(each_object['name']) pose = SubElement(object_item, 'pose') pose.text = "Unspecified" truncated = SubElement(object_item, 'truncated')