Add ustr.py, add more test, and fix build error for py3

This commit is contained in:
tzutalin
2017-05-03 16:13:08 +08:00
parent 4ee8287e51
commit 9a7ecb4a07
4 changed files with 75 additions and 62 deletions
+14
View File
@@ -1,8 +1,12 @@
import _init_path
from unittest import TestCase
from labelImg import get_main_app
from pascal_voc_io import PascalVocWriter
from pascal_voc_io import PascalVocReader
class TestMainWindow(TestCase):
@@ -18,3 +22,13 @@ class TestMainWindow(TestCase):
def test_noop(self):
pass
# Test Write/Read
writer = PascalVocWriter('tests', 'test', (512, 512, 1), localImgPath='tests/test.bmp')
difficult = 1
writer.addBndBox(60, 40, 430, 504, 'person', difficult)
writer.addBndBox(113, 40, 450, 403, 'face', difficult)
writer.save('tests/test.xml')
reader = PascalVocReader('tests/test.xml')
shapes = reader.getShapes()