Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions labelbox/schema/data_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ def export_v2(client: 'Client',
"media_type_override": None,
"model_run_ids": None,
"project_ids": None,
"interpolated_frames": False,
})

validate_catalog_export_params(_params)
Expand Down Expand Up @@ -235,6 +236,8 @@ def export_v2(client: 'Client',
_params.get('performance_details', False),
"includeLabelDetails":
_params.get('label_details', False),
"includeInterpolatedFrames":
_params.get('interpolated_frames', False),
"projectIds":
_params.get('project_ids', None),
"modelRunIds":
Expand Down
3 changes: 3 additions & 0 deletions labelbox/schema/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@ def export_v2(self,
"media_type_override": None,
"model_run_ids": None,
"project_ids": None,
"interpolated_frames": False,
})
validate_catalog_export_params(_params)

Expand Down Expand Up @@ -612,6 +613,8 @@ def export_v2(self,
_params.get('performance_details', False),
"includeLabelDetails":
_params.get('label_details', False),
"includeInterpolatedFrames":
_params.get('interpolated_frames', False),
"projectIds":
_params.get('project_ids', None),
"modelRunIds":
Expand Down
2 changes: 2 additions & 0 deletions labelbox/schema/export_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class ProjectExportParams(DataRowParams):
project_details: Optional[bool]
label_details: Optional[bool]
performance_details: Optional[bool]
interpolated_frames: Optional[bool]


class CatalogExportParams(DataRowParams):
Expand All @@ -30,6 +31,7 @@ class CatalogExportParams(DataRowParams):
performance_details: Optional[bool]
model_run_ids: Optional[List[str]]
project_ids: Optional[List[str]]
interpolated_frames: Optional[bool]


class ModelRunExportParams(DataRowParams):
Expand Down
7 changes: 5 additions & 2 deletions labelbox/schema/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,8 @@ def export_v2(self,
"project_details": False,
"performance_details": False,
"label_details": False,
"media_type_override": None
"media_type_override": None,
"interpolated_frames": False,
})

_filters = filters or ProjectExportFilters({
Expand Down Expand Up @@ -474,7 +475,9 @@ def export_v2(self,
"includePerformanceDetails":
_params.get('performance_details', False),
"includeLabelDetails":
_params.get('label_details', False)
_params.get('label_details', False),
"includeInterpolatedFrames":
_params.get('interpolated_frames', False),
},
}
}
Expand Down
3 changes: 3 additions & 0 deletions labelbox/schema/slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def export_v2(self,
"media_type_override": None,
"model_run_ids": None,
"project_ids": None,
"interpolated_frames": False,
})
validate_catalog_export_params(_params)

Expand Down Expand Up @@ -118,6 +119,8 @@ def export_v2(self,
_params.get('performance_details', False),
"includeLabelDetails":
_params.get('label_details', False),
"includeInterpolatedFrames":
_params.get('interpolated_frames', False),
"projectIds":
_params.get('project_ids', None),
"modelRunIds":
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/annotation_import/fixtures/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def bbox_video_annotation_objects():
frame=19,
segment_index=0,
value=Rectangle(
start=Point(x=146.0, y=98.0), # Top left
end=Point(x=382.0, y=341.0), # Bottom right
start=Point(x=186.0, y=98.0), # Top left
end=Point(x=490.0, y=341.0), # Bottom right
))
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def bbox_video_annotation_objects():
frame=19,
segment_index=0,
value=Rectangle(
start=Point(x=146.0, y=98.0), # Top left
end=Point(x=382.0, y=341.0), # Bottom right
start=Point(x=186.0, y=98.0), # Top left
end=Point(x=490.0, y=341.0), # Bottom right
))
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ def test_export_v2_video(client, configured_project_without_data_rows,
num_retries = 5
task = None
while (num_retries > 0):
task = project.export_v2(params={
"performance_details": False,
"label_details": True
})
task = project.export_v2(
params={
"performance_details": False,
"label_details": True,
"interpolated_frames": True
})
task.wait_till_done()
assert task.status == "COMPLETE"
assert task.errors is None
Expand Down Expand Up @@ -168,6 +170,32 @@ def test_export_v2_video(client, configured_project_without_data_rows,
all_frames_exported.append(value)
assert (len(all_frames_exported) == 0)

# BEGINNING OF THE VIDEO INTERPOLATION ASSERTIONS
first_frame_id = bbox_video_annotation_objects[0].frame
last_frame_id = bbox_video_annotation_objects[-1].frame

# Generate list of frames with frames in between, e.g. 13, 14, 15, 16, 17, 18, 19
expected_frame_ids = list(range(first_frame_id, last_frame_id + 1))

assert export_frames_ids == expected_frame_ids

exported_objects_dict = export_frames[str(first_frame_id)]['objects']

# Get the label ID
first_exported_label_id = list(exported_objects_dict.keys())[0]

# Since the bounding box moves to the right, the interpolated frame content should start a little bit more far to the right
assert export_frames[str(first_frame_id + 1)]['objects'][
first_exported_label_id]['bounding_box']['left'] > export_frames[
str(first_frame_id
)]['objects'][first_exported_label_id]['bounding_box']['left']
# But it shouldn't be further than the last frame
assert export_frames[str(first_frame_id + 1)]['objects'][
first_exported_label_id]['bounding_box']['left'] < export_frames[
str(last_frame_id
)]['objects'][first_exported_label_id]['bounding_box']['left']
# END OF THE VIDEO INTERPOLATION ASSERTIONS

frame_with_nested_classifications = export_frames['13']
annotation = None
for _, a in frame_with_nested_classifications['objects'].items():
Expand Down