diff --git a/sloth/annotations/container.py b/sloth/annotations/container.py index 8b71a45..8545e9d 100644 --- a/sloth/annotations/container.py +++ b/sloth/annotations/container.py @@ -258,11 +258,11 @@ class FeretContainer(AnnotationContainer): 'type': 'image', } fileitem['annotations'] = [ - {'type': 'point', 'class': 'left_eye', + {'class': 'left_eye', 'x': int(s[1]), 'y': int(s[2])}, - {'type': 'point', 'class': 'right_eye', + {'class': 'right_eye', 'x': int(s[3]), 'y': int(s[4])}, - {'type': 'point', 'class': 'mouth', + {'class': 'mouth', 'x': int(s[5]), 'y': int(s[6])} ] annotations.append(fileitem) diff --git a/sloth/conf/default_config.py b/sloth/conf/default_config.py index f4fd1c4..7bd4822 100644 --- a/sloth/conf/default_config.py +++ b/sloth/conf/default_config.py @@ -11,7 +11,7 @@ # LABLES # -# List/tuple of dictionaries that defines the label types +# List/tuple of dictionaries that defines the label classes # that are handled by sloth. For each label, there should # be one dictionary that contains the following keys: # @@ -20,17 +20,17 @@ # implementing the visualization item interface. # # - 'inserter' : (optional) Item inserter for this label. -# If the user selects to insert a new label of this type +# If the user selects to insert a new label of this class # the inserter is responsible to actually # capture the users mouse actions and insert # a new label into the annotation model. # # - 'hotkey' : (optional) A keyboard shortcut starting -# the insertion of a new label of this type. +# the insertion of a new label of this class. # # - 'attributes' : (optional) A dictionary that defines the # keys and possible values of this label -# type. +# class. LABELS = ( { 'attributes': { diff --git a/sloth/conf/template/config_template.py b/sloth/conf/template/config_template.py index 679c548..38764c3 100644 --- a/sloth/conf/template/config_template.py +++ b/sloth/conf/template/config_template.py @@ -11,7 +11,7 @@ # LABLES # -# List/tuple of dictionaries that defines the label types +# List/tuple of dictionaries that defines the label classes # that are handled by sloth. For each label, there should # be one dictionary that contains the following keys: # @@ -20,21 +20,21 @@ # implementing the visualization item interface. # # - 'inserter' : (optional) Item inserter for this label. -# If the user selects to insert a new label of this type +# If the user selects to insert a new label of this class # the inserter is responsible to actually # capture the users mouse actions and insert # a new label into the annotation model. # # - 'hotkey' : (optional) A keyboard shortcut starting -# the insertion of a new label of this type. +# the insertion of a new label of this class. # # - 'attributes' : (optional) A dictionary that defines the # keys and possible values of this label -# type. +# class. LABELS = ( { 'attributes': { - 'type': 'rect', + 'class': 'rect', }, 'inserter': 'sloth.items.RectItemInserter', 'item': 'sloth.items.RectItem', @@ -42,7 +42,7 @@ LABELS = ( }, { 'attributes': { - 'type': 'point', + 'class': 'point', }, 'inserter': 'sloth.items.PointItemInserter', 'item': 'sloth.items.PointItem', diff --git a/sloth/items/inserters.py b/sloth/items/inserters.py index 65f2e57..feeec31 100644 --- a/sloth/items/inserters.py +++ b/sloth/items/inserters.py @@ -33,8 +33,7 @@ class ItemInserter(QObject): class PointItemInserter(ItemInserter): def mousePressEvent(self, event, image_item): pos = event.scenePos() - ann = {'type': 'point', - 'x': pos.x(), 'y': pos.y()} + ann = {'x': pos.x(), 'y': pos.y()} ann.update(self.default_properties_) image_item.addAnnotation(ann) event.accept() @@ -67,8 +66,7 @@ class RectItemInserter(ItemInserter): if self.current_item_.rect().width() > 1 and \ self.current_item_.rect().height() > 1: rect = self.current_item_.rect() - ann = {'type': 'rect', - 'x': rect.x(), 'y': rect.y(), + ann = {'x': rect.x(), 'y': rect.y(), 'width': rect.width(), 'height': rect.height()} ann.update(self.default_properties_) image_item.addAnnotation(ann)