|
@@ -41,6 +41,7 @@ class PipelineManager:
|
|
for identifier in self.project['data']:
|
|
for identifier in self.project['data']:
|
|
obj = self.project['data'][identifier]
|
|
obj = self.project['data'][identifier]
|
|
media = {
|
|
media = {
|
|
|
|
+ 'type': obj['type'],
|
|
'name': obj['name'],
|
|
'name': obj['name'],
|
|
'extension': obj['extension'],
|
|
'extension': obj['extension'],
|
|
'size': obj['size'],
|
|
'size': obj['size'],
|
|
@@ -54,28 +55,26 @@ class PipelineManager:
|
|
continue
|
|
continue
|
|
|
|
|
|
if 'x' not in prediction:
|
|
if 'x' not in prediction:
|
|
- media['predictionResults'].append({
|
|
|
|
|
|
+ o = {
|
|
'type': 'labeled-image',
|
|
'type': 'labeled-image',
|
|
'label': prediction['label']
|
|
'label': prediction['label']
|
|
- })
|
|
|
|
|
|
+ }
|
|
else:
|
|
else:
|
|
|
|
+ o = {
|
|
|
|
+ 'type': 'bounding-box',
|
|
|
|
+ 'x': prediction['x'],
|
|
|
|
+ 'y': prediction['y'],
|
|
|
|
+ 'w': prediction['w'],
|
|
|
|
+ 'h': prediction['h']
|
|
|
|
+ }
|
|
|
|
+
|
|
if 'label' in prediction:
|
|
if 'label' in prediction:
|
|
- media['predictionResults'].append({
|
|
|
|
- 'type': 'labeled-bounding-box',
|
|
|
|
- 'x': prediction['x'],
|
|
|
|
- 'y': prediction['y'],
|
|
|
|
- 'w': prediction['w'],
|
|
|
|
- 'h': prediction['h'],
|
|
|
|
- 'label': prediction['label']
|
|
|
|
- })
|
|
|
|
- else:
|
|
|
|
- media['predictionResults'].append({
|
|
|
|
- 'type': 'bounding-box',
|
|
|
|
- 'x': prediction['x'],
|
|
|
|
- 'y': prediction['y'],
|
|
|
|
- 'w': prediction['w'],
|
|
|
|
- 'h': prediction['h']
|
|
|
|
- })
|
|
|
|
|
|
+ o['type'] = 'labeled-bounding-box'
|
|
|
|
+ o['label'] = prediction['label']
|
|
|
|
+ if 'frame' in prediction:
|
|
|
|
+ o['frame'] = prediction['frame']
|
|
|
|
+
|
|
|
|
+ media['predictionResults'].append(o)
|
|
|
|
|
|
data.append(media)
|
|
data.append(media)
|
|
|
|
|