Remove remaining instances of 'type'

This commit is contained in:
Mika Fischer
2011-06-29 16:20:17 +02:00
parent dca319a919
commit 07bbce9090
4 changed files with 15 additions and 17 deletions
+3 -3
View File
@@ -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)
+4 -4
View File
@@ -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': {
+6 -6
View File
@@ -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',
+2 -4
View File
@@ -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)