The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
Error code: DatasetGenerationError
Exception: CastError
Message: Couldn't cast
messages: list<item: struct<role: string, content: string>>
child 0, item: struct<role: string, content: string>
child 0, role: string
child 1, content: string
metadata: struct<video: string, t_start: double, t_end: double, text_source: string>
child 0, video: string
child 1, t_start: double
child 2, t_end: double
child 3, text_source: string
to
{'messages': List({'role': Value('string'), 'content': Json(decode=True)})}
because column names don't match
Traceback: Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1872, in _prepare_split_single
for key, table in generator:
^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/packaged_modules/json/json.py", line 289, in _generate_tables
self._cast_table(pa_table, json_field_paths=json_field_paths),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/packaged_modules/json/json.py", line 124, in _cast_table
pa_table = table_cast(pa_table, self.info.features.arrow_schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2272, in table_cast
return cast_table_to_schema(table, schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2218, in cast_table_to_schema
raise CastError(
datasets.table.CastError: Couldn't cast
messages: list<item: struct<role: string, content: string>>
child 0, item: struct<role: string, content: string>
child 0, role: string
child 1, content: string
metadata: struct<video: string, t_start: double, t_end: double, text_source: string>
child 0, video: string
child 1, t_start: double
child 2, t_end: double
child 3, text_source: string
to
{'messages': List({'role': Value('string'), 'content': Json(decode=True)})}
because column names don't match
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1347, in compute_config_parquet_and_info_response
parquet_operations = convert_to_parquet(builder)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 980, in convert_to_parquet
builder.download_and_prepare(
File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 884, in download_and_prepare
self._download_and_prepare(
File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 947, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1739, in _prepare_split
for job_id, done, content in self._prepare_split_single(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1922, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.exceptions.DatasetGenerationError: An error occurred while generating the datasetNeed help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
messages list |
|---|
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
[
{
"role": "system",
"content": "You are a precise visual observer of surgical video. Your only job is to describe what you can see — not to interpret, diagnose, or infer clinical conclusions. Downstream systems handle clinical interpretation.\n\nRULES:\n1. Output 3-5 sentences in past tense, passive voice. ... |
OpenSurgery Ortho
A multimodal fine-tuning dataset pairing sequences of surgical video keyframes with surgeon narration transcripts, built to train vision-language models (VLMs) on orthopedic surgical captioning.
Dataset Summary
| Split | Records | Source |
|---|---|---|
| Train | 2,417 | 90% stratified by video |
| Val | 265 | 10% stratified by video |
| Total | 2,682 | 8 surgical videos |
Each record contains 5 keyframes extracted from a 15-second sliding window (5-second stride) paired with the surgeon's narration text for that time interval.
Procedures Covered
| Video | Procedure | Records |
|---|---|---|
| TKA | Total Knee Arthroplasty | 292 |
| TKA_2 | Total Knee Arthroplasty (case 2) | 257 |
| HipArthoplasty | Total Hip Arthroplasty | 392 |
| THA_2 | Total Hip Arthroplasty (case 2) | 426 |
| THA_3 | Total Hip Arthroplasty (case 3) | 273 |
| HipResurfacing | Hip Resurfacing | 483 |
| HipResurface_2 | Hip Resurfacing (case 2) | 254 |
| BigToeFusion | MTP Arthrodesis (Big Toe Fusion) | 305 |
Dataset Versions
finetune_v2 (current, recommended)
High-quality multimodal dataset with 5 frames per window. Text sourced from cleaned structured transcripts (surgeon narration), with faster-whisper fallback for segments not covered by the transcript. Built with a rigorous quality filter chain.
finetune_v1 (legacy)
Single-frame dataset with simpler windowing. Superseded by v2.
How It Was Created
Step 1 — Transcription
Each surgical video has a structured transcript written by the operating surgeon narrating what they are doing in real time. These were cleaned and aligned to video timestamps using faster-whisper (large-v3, word-level timestamps, language=en).
Step 2 — Windowing
A sliding window of 15 seconds with 5-second stride is swept across each video's word-level timestamp timeline. For each window, the overlapping surgeon narration text is extracted by interval-overlap sentence slicing (not midpoint assignment), preserving complete sentences.
Step 3 — Frame Extraction
5 frames are evenly sampled from each 15-second window using OpenCV. Frames are saved as JPEG at native video resolution.
Step 4 — Quality Filtering
Records are dropped if any of the following apply:
- Fewer than 8 words in the narration text
- More than 200 words (likely a runaway window)
- Phrase loop detected — any 3-6 word phrase repeated 5+ times (transcript artifact)
- Non-English text detected
- Non-visual narration — introductory/conceptual text with no surgical content
- Bad frames — any frame that fails to load
Step 5 — Split
90/10 train/val split stratified by video — all records from a given video stay in the same split to prevent data leakage.
Record Format (JSONL)
Each line in finetune_v2/train.jsonl and finetune_v2/val.jsonl is a JSON object in LLaMA-Factory multi-image format:
{
"messages": [
{
"role": "system",
"content": "You are a precise visual observer of surgical video..."
},
{
"role": "user",
"content": [
{"type": "image", "image": "<path_or_url_to_frame_0>"},
{"type": "image", "image": "<path_or_url_to_frame_1>"},
{"type": "image", "image": "<path_or_url_to_frame_2>"},
{"type": "image", "image": "<path_or_url_to_frame_3>"},
{"type": "image", "image": "<path_or_url_to_frame_4>"},
{"type": "text", "text": "Describe the scene in this surgical video frame..."}
]
},
{
"role": "assistant",
"content": "The surgeon is placing a tibial baseplate trial..."
}
],
"metadata": {
"video": "TKA",
"t_start": 120.0,
"t_end": 135.0,
"text_source": "structured"
}
}
Fields:
messages— standard chat format compatible with LLaMA-Factory, Axolotl, and HuggingFace TRLmetadata.video— source video identifiermetadata.t_start/t_end— window timestamps in secondsmetadata.text_source—"structured"(surgeon transcript) or"whisper"(ASR fallback)
How to Use for Fine-tuning
Option A — LLaMA-Factory (native format)
The JSONL files are directly compatible with LLaMA-Factory's multi-image training pipeline.
- Register the dataset in
data/dataset_info.json:
"opensurgery_ortho_train": {
"file_name": "finetune_v2/train.jsonl",
"formatting": "sharegpt",
"columns": {"messages": "messages", "images": "images"}
}
- Set
dataset: opensurgery_ortho_trainin your LLaMA-Factory YAML config.
Option B — HuggingFace TRL / SFTTrainer
from datasets import load_dataset
from trl import SFTTrainer, SFTConfig
dataset = load_dataset("opscribe-ai/OpenSurgery_Ortho", data_files={
"train": "finetune_v2/train.jsonl",
"validation": "finetune_v2/val.jsonl"
})
Option C — qwen-vl-finetune (Qwen official)
Convert to qwen-vl-finetune JSON format using the provided conversion script:
python3 scripts/convert_finetune_v2.py \
--v2_dir /path/to/local/finetune_v2 \
--out_dir /path/to/output \
--new_prefix /path/to/frames
This produces a JSON array where each record has:
"image": list of 5 frame paths"conversations":[{"from": "human", "value": "..."}, {"from": "gpt", "value": "..."}]
Recommended Training Config
| Parameter | Value |
|---|---|
| Model | Qwen2.5-VL-7B or 72B |
| LoRA rank | 32–64 |
| Epochs | 3 |
| Batch size | 1 per GPU |
| Grad accumulation | 16 |
| Learning rate | 2e-5 |
| Max pixels | 576×28×28 |
| Images per sample | 5 |
Source Videos
Raw surgical videos are included in OpScribe_Ortho_Media/. These are real orthopedic procedures with surgeon narration recorded for educational and research purposes.
Citation
If you use this dataset, please cite:
@dataset{opensurgery_ortho_2026,
author = {OpScribe AI},
title = {OpenSurgery Ortho: Surgical Video VLM Fine-tuning Dataset},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/datasets/opscribe-ai/OpenSurgery_Ortho}
}
License
MIT — see LICENSE for details. Clinical use requires independent validation.
- Downloads last month
- 71