Add ustr.py, add more test, and fix build error for py3
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user