mirror of
https://github.com/wassname/sloth.git
synced 2026-07-09 18:04:21 +08:00
add annotation accessor to labeltool object
This commit is contained in:
@@ -65,8 +65,7 @@ class DumpLabelsCommand(BaseCommand):
|
||||
raise CommandError("Expect exactly 1 argument.")
|
||||
|
||||
self.labeltool.loadAnnotations(args[0])
|
||||
# TODO add better accessor the the labeltool
|
||||
pprint(self.labeltool._container.annotations())
|
||||
pprint(self.labeltool.annotations())
|
||||
|
||||
|
||||
class AppendFilesCommand(BaseCommand):
|
||||
|
||||
@@ -235,6 +235,11 @@ class LabelTool(QObject):
|
||||
self.statusMessage.emit(msg)
|
||||
self.annotationsLoaded.emit()
|
||||
|
||||
def annotations(self):
|
||||
if self._model is None:
|
||||
return None
|
||||
return self._model.root().getAnnotations()
|
||||
|
||||
def saveAnnotations(self, fname):
|
||||
success = False
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user