Bopa-Boptech/VLM-Cholecystectomie
0
Surgical Phase Recognition Demo
This Hugging Face Space demonstrates two models for surgical phase recognition:
- VLM (Baseline): A Vision-Language Model (Qwen2-VL based)
- ViT (Vision Transformer): A specialized surgical transformer
Setup
The app is designed to run on Hugging Face Spaces (CPU Basic tier). Because the VLM is too heavy to run in real-time on CPU, we use pre-computed predictions for the demo.
Pre-computing Predictions
To update the predictions (e.g., after changing models or data), run the precomputation script on a machine with a GPU:
cd hf_space
uv run precompute_predictions.pyThis will generate data/test_df_with_preds.csv. The app.py will automatically detect this file and use it to serve predictions instantly.
Running the App
To run the app locally:
cd hf_space
uv run app.pyThis demo runs in lightweight mode using precomputed predictions only. Live inference is disabled to support free CPU tier deployment.
