Fix issue serializing qstring in pscal_voc_io.py

This commit is contained in:
tzutalin
2018-11-18 09:28:38 -08:00
parent f563c164d0
commit 2df7b6e402
+3 -2
View File
@@ -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')