add test script for testing the annotationmodel with ModelTest

This commit is contained in:
Martin Baeuml
2011-06-17 14:27:28 +02:00
parent b6cb4d6bf3
commit 87fd2f04a3
6 changed files with 60 additions and 0 deletions
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

+33
View File
@@ -0,0 +1,33 @@
[
{
"type": "image",
"annotations": [
{
"height": 60.0,
"width": 46.0,
"y": 105.0,
"x": 346.0,
"type": "rect"
},
{
"height": 58.0,
"width": 56.0,
"y": 119.0,
"x": 636.0,
"type": "rect"
}
],
"filename": "image1.jpg"
},
{
"type": "image",
"annotations": [
{
"y": 155.0,
"x": 409.0,
"type": "point"
}
],
"filename": "image2.jpg"
}
]
Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env python
import os, sys
from PyQt4.QtGui import QApplication
from sloth.gui import MainWindow
from sloth.core.labeltool import LabelTool
from sloth import APP_NAME, ORGANIZATION_NAME, ORGANIZATION_DOMAIN
from pymodeltest.modeltest import ModelTest
SAMPLE_DATA = os.path.join(os.path.dirname(__file__), 'data', 'example1_labels.json')
if __name__ == '__main__':
app = QApplication(sys.argv)
app.setOrganizationName(ORGANIZATION_NAME)
app.setOrganizationDomain(ORGANIZATION_DOMAIN)
app.setApplicationName(APP_NAME)
labeltool = LabelTool()
if len(sys.argv) < 2:
sys.argv.append(SAMPLE_DATA)
labeltool.execute_from_commandline(sys.argv)
labeltool.modeltest = ModelTest(labeltool._model, labeltool)
wnd = MainWindow(labeltool)
labeltool._mainwindow = wnd
wnd.show()
sys.exit(app.exec_())