HumanSignal / HumanSignal/label-studio-sdk
Export interpolate key frames in video label not working
- Dominant language
- Python
- Stars
- 192
- Forks
- 127
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 1
Description
I was trying to export the interpolated key frames using Label Studio SDK api and followed the code given on this page. link: https://labelstud.io/templates/video_object_detector
This link's code did not work, I think it might be due to update of label studio and the blog is outdated. However, I modified the code and now it works.
I will post the code I use here:
```
from label_studio_sdk import Client
import time
# Connect to Label Studio
ls = Client(url='http://localhost:8080', api_key='YOUR_API_KEY')
# Get your project by ID
project = ls.get_project(PROJECT_ID)
# Create an export snapshot with interpolation enabled
export_result = project.export_snapshot_create(
title='Export with Interpolated Keyframes',
interpolate_key_frames = True
)
# Get the export ID
export_id = export_result['id']
# Wait for the export to complete
while True:
export_status = project.export_snapshot_status(export_id)
if export_status.is_completed():
break
elif export_status.is_failed():
raise Exception('Export failed')
else:
time.sleep(5) # Wait for 5 seconds before checking again
# Download the export
export_file_path = project.export_snapshot_download(
export_id, export_type='JSON', path='.'
)
print(f'Exported data saved to {export_file_path}')
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.