mirror of
https://github.com/wassname/sloth.git
synced 2026-06-27 17:17:21 +08:00
add test script for testing the annotationmodel with ModelTest
This commit is contained in:
BIN
Binary file not shown.
|
After Width: | Height: | Size: 136 KiB |
@@ -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 |
@@ -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_())
|
||||
Reference in New Issue
Block a user