Skip to main content

orena-focus

Tests PyPI Python License: MIT MICCAI 2026

HeiCo-FOCUS dataset

License: CC BY-NC-SA 4.0 Dataset

LapChole-FOCUS dataset

License: Data Usage Agreement Dataset


Python utilities for the FOCUS datasets and challenge — Foreign Object Contextual Understanding for Surgery.

The library provides dataset loaders, preprocessing pipelines, answer-format handling, and an evaluation framework for working with the FOCUS surgical VQA datasets. It can be used independently for research on foreign-object understanding in minimally invasive surgery, and also serves as the official toolkit for the ORena SAVE FOCUS challenge at MICCAI 2026.

Challenge open for registration. Submit your results and compete on the leaderboard at orena-focus-challenge.org.

Clinical use case

Retained foreign objects are a life-threatening and preventable surgical complication. FOCUS benchmarks vision-language models on clinically relevant VQA tasks around detecting, counting, and reasoning about foreign objects in endoscopic video.

Tracks

FOCUS offers three participation tracks, each requiring a different type of visual context:

Track Track enum Visual input Max latency Description
FRAME Track.FRAME Single frame 5 s Answer questions from one extracted video frame. The simplest entry point — no temporal modelling required.
SEGMENT Track.SEGMENT <= 5min clip 15 s Answer questions from a multi-second video segment surrounding the relevant event. Requires understanding of motion and temporal context.
PROCEDURE Track.PROCEDURE Up to full video 30 s Answer questions that may require reasoning over an entire surgical procedure, including events that happened well before or after the queried moment.

Participants may enter any subset of tracks. Each track is evaluated independently with the same hierarchical capability taxonomy.

Installation

pip install orena-focus

Quick start

from focus import FocusDataset, DatasetSplit, Track

ds = FocusDataset("heico", DatasetSplit.TEST, Track.SEGMENT)

request, reference = ds[0]
print(request.question)        # "How many sponges are visible?"
print(reference.answer)        # "2"
print(reference.format.type)   # "number"

Data preparation

Download, preprocess, and split the dataset in one script — see examples/data_preparation.py for the full walkthrough.

from focus import download
from focus.preprocessing import VideoTimestampOverlayPreprocessor, FrameExtractorPreprocessor

download("heico")

VideoTimestampOverlayPreprocessor().process(dataset="heico")
FrameExtractorPreprocessor(stride=1).process(dataset="heico")

QA annotations are fetched automatically from HuggingFace when you construct a FocusDataset.

Inference & evaluation

See examples/inference.py for an end-to-end example with Qwen3-VL.

from focus import Evaluator, Response

responses = [Response(qID=req.qID, content=my_model(req)) for req, _ in ds]

results_df, summary_df = Evaluator().run(
    requests=ds.requests,
    references=ds.references,
    responses=responses,
)
print(summary_df)

Pre-evaluation score

The pre-evaluation phase uses a single headline number: the unweighted mean over ten buckets — the five capability groups, each scored independently for in-distribution and out-of-distribution questions (flat per-question accuracy within each bucket). Missing and timed-out answers count as incorrect. It is reported as the level="pre_evaluation", name="SCORE" row of summary_df, and can also be computed directly:

score, buckets_df = Evaluator().pre_evaluation_score(results_df)

Capability taxonomy

Five capability groups, each composed of leaf capabilities assigned to questions.

SAVE FOCUS capability taxonomy with example questions

Answer formats

Format Accepts Returns
Binary "yes" / "no" bool
Number Non-negative integer strings int
Percentage Numeric percentage strings float
FOClass One or more registered FO class names (comma-separated) frozenset[str]
OpenEnded Free text (≤ 300 chars) str
Matching Regex-validated text str
MultipleChoice One of predefined options str
Time One or more hh:mm:ss timestamps (comma-separated) tuple[timedelta, ...]

Datasets

FOCUS builds upon two datasets: HeiCo-FOCUS (30 videos) and LapChole-FOCUS (170 videos).

HeiCo-FOCUS

The QA annotations are publicly available on HuggingFace: orena-dkfz/heico-focus-vqa.

HeiCo-FOCUS is built on the HeiCo dataset. If you use this data, please cite the original publication:

Maier-Hein, L., et al. (2021). Heidelberg colorectal data set for surgical data science in the sensor operating room. https://doi.org/10.1038/s41597-021-00882-2

The HeiCo data is released under CC BY-NC-SA 4.0 — non-commercial use only, with attribution and share-alike conditions.

LapChole-FOCUS

The LapChole-FOCUS videos comprises unpublished laparoscopic cholecystectomy recordings. It is currently only available within the scope of the FOCUS-Challenge and will be publicly released after the Challenge has ended.

To access it, send a request on HuggingFace: orena-dkfz/lapchole-focus-vqa. To access and download the data you need to register yourself with HuggingFace.

Please find the data usage agreement at the dataset card or in the LICENSE file on HuggingFace.

License

The code is licensed under the permissive MIT license. The underlying data is licensed independently, see Dataset for the data licenses details.

Metadata

Release files for orena-focus 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for orena-focus 0.4.0
File Size Uploaded
orena_focus-0.4.0.tar.gz 1.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for orena-focus 0.4.0
File Interpreter ABI Platform
orena_focus-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 2.5 MB

Release files / orena_focus-0.4.0.tar.gz

Download URL orena_focus-0.4.0.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
33aa425c6dcf0b71ee4dff3da9c8baa7efc7b3f301aca31e86010f518b6266e3
BLAKE2b-256 checksum
How to use checksums
0dc90b693ec136d06677baf10a6a6d239945f505a77aee7677860e45caad6d4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release files / orena_focus-0.4.0-py3-none-any.whl

Download URL orena_focus-0.4.0-py3-none-any.whl
Size 1.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
14c172fb15d715778c930c9d36c645b412927111318e9086fb195478e1ba2ba7
BLAKE2b-256 checksum
How to use checksums
cc83b2d05d4683903c9fec6d6cbe6c382a8af34dc8f3ae04cbce45e4f8f223f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page