Commit 8ac7d28e authored by Samuel GAIST's avatar Samuel GAIST

[advanced][databases][replay] Fix annotations loading

The objects are created from JSON data using the default
decoder therefore they contain only base types that must
be converted. Thus annotations is a list of list and should
be parsed like that.
parent 408cc1f5
......@@ -151,13 +151,13 @@ class All(View):
elif output == 'annotations':
annotations_list = []
for i in range(obj.annotations.shape[0]):
for annotation in obj.annotations:
annotations_list.append({
'frame_id': np.uint64(obj.annotations[i][0]),
'top-left-x': np.int32(obj.annotations[i][1]),
'top-left-y': np.int32(obj.annotations[i][2]),
'width': np.int32(obj.annotations[i][3]),
'height': np.int32(obj.annotations[i][4])
'frame_id': np.uint64(annotation[0]),
'top-left-x': np.int32(annotation[1]),
'top-left-y': np.int32(annotation[2]),
'width': np.int32(annotation[3]),
'height': np.int32(annotation[4])
})
return {
......@@ -244,13 +244,13 @@ class Templates(View):
elif output == 'annotations':
annotations_list = []
for i in range(obj.annotations.shape[0]):
for annotation in obj.annotations:
annotations_list.append({
'frame_id': np.uint64(obj.annotations[i][0]),
'top-left-x': np.int32(obj.annotations[i][1]),
'top-left-y': np.int32(obj.annotations[i][2]),
'width': np.int32(obj.annotations[i][3]),
'height': np.int32(obj.annotations[i][4])
'frame_id': np.uint64(annotation[0]),
'top-left-x': np.int32(annotation[1]),
'top-left-y': np.int32(annotation[2]),
'width': np.int32(annotation[3]),
'height': np.int32(annotation[4])
})
return {
......@@ -348,13 +348,13 @@ class ProbesReal(View):
elif output == 'annotations':
annotations_list = []
for i in range(obj.annotations.shape[0]):
for annotation in obj.annotations:
annotations_list.append({
'frame_id': np.uint64(obj.annotations[i][0]),
'top-left-x': np.int32(obj.annotations[i][1]),
'top-left-y': np.int32(obj.annotations[i][2]),
'width': np.int32(obj.annotations[i][3]),
'height': np.int32(obj.annotations[i][4])
'frame_id': np.uint64(annotation[0]),
'top-left-x': np.int32(annotation[1]),
'top-left-y': np.int32(annotation[2]),
'width': np.int32(annotation[3]),
'height': np.int32(annotation[4])
})
return {
......@@ -470,13 +470,13 @@ class ProbesAttack(View):
elif output == 'annotations':
annotations_list = []
for i in range(obj.annotations.shape[0]):
for annotation in obj.annotations:
annotations_list.append({
'frame_id': np.uint64(obj.annotations[i][0]),
'top-left-x': np.int32(obj.annotations[i][1]),
'top-left-y': np.int32(obj.annotations[i][2]),
'width': np.int32(obj.annotations[i][3]),
'height': np.int32(obj.annotations[i][4])
'frame_id': np.uint64(annotation[0]),
'top-left-x': np.int32(annotation[1]),
'top-left-y': np.int32(annotation[2]),
'width': np.int32(annotation[3]),
'height': np.int32(annotation[4])
})
return {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment