diff --git a/sloth/core/commands.py b/sloth/core/commands.py index b8d997c..d3e1e60 100644 --- a/sloth/core/commands.py +++ b/sloth/core/commands.py @@ -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): diff --git a/sloth/core/labeltool.py b/sloth/core/labeltool.py index 8b16e70..e09bc06 100755 --- a/sloth/core/labeltool.py +++ b/sloth/core/labeltool.py @@ -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: