Rename type to class for FileModelItems

This commit is contained in:
Mika Fischer
2011-06-29 16:30:33 +02:00
parent 5300781f22
commit ab46377de7
4 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
[
{
"type": "image",
"class": "image",
"annotations": [
{
"height": 60.0,
@@ -20,7 +20,7 @@
"filename": "image1.jpg"
},
{
"type": "image",
"class": "image",
"annotations": [
{
"y": 155.0,
+2 -2
View File
@@ -227,7 +227,7 @@ class FileNameListContainer(AnnotationContainer):
line = line.strip()
fileitem = {
'filename': line,
'type': 'image',
'class': 'image',
'annotations': [],
}
annotations.append(fileitem)
@@ -255,7 +255,7 @@ class FeretContainer(AnnotationContainer):
s = line.split()
fileitem = {
'filename': s[0] + ".bmp",
'type': 'image',
'class': 'image',
}
fileitem['annotations'] = [
{'class': 'left_eye',
+3 -3
View File
@@ -240,7 +240,7 @@ class KeyValueModelItem(ModelItem, MutableMapping):
return res
class FileModelItem(KeyValueModelItem):
def __init__(self, fileinfo, hidden=['filename', 'type']):
def __init__(self, fileinfo, hidden=['filename', 'class']):
KeyValueModelItem.__init__(self, hidden=hidden)
self.update(fileinfo)
@@ -251,9 +251,9 @@ class FileModelItem(KeyValueModelItem):
@staticmethod
def create(fileinfo):
if fileinfo['type'] == 'image':
if fileinfo['class'] == 'image':
return ImageFileModelItem(fileinfo)
elif fileinfo['type'] == 'video':
elif fileinfo['class'] == 'video':
return VideoFileModelItem(fileinfo)
class ImageModelItem(ModelItem):
+2 -2
View File
@@ -316,7 +316,7 @@ class LabelTool(QObject):
def addImageFile(self, fname):
fileitem = {
'filename': fname,
'type': 'image',
'class': 'image',
'annotations': [ ],
}
self._model._root.appendFileItem(fileitem)
@@ -324,7 +324,7 @@ class LabelTool(QObject):
def addVideoFile(self, fname):
fileitem = {
'filename': fname,
'type': 'video',
'class': 'video',
'frames': [ ],
}