Project Info
Inspiration
Medical errors kill an estimated 2.6–3 million people globally each year. Every surgery follows a protocol, yet compliance is formally tracked in only a small fraction of cases. Feedback is delayed, manual, and often limited to post-operative notes. We asked: What if the operating room had a flight data recorder and a live command center? What It Does VIPER transforms first-person surgical video into structured, clinically actionable intelligence. Using smart-glasses/video capture, the vision pipeline extracts instrument and anatomy segmentation, tracks instrument tip trajectories across frames, estimates full 6D instrument pose, recovers surgeon hand joint positions, and segments continuous motion into discrete surgical strokes. This spatial data then feeds into a reasoning layer that maps observed actions to structured surgical protocols, flags missing, out-of-order, or unsafe steps, and cross-references each deviation against published surgical literature. But VIPER isn't just a backend engine. All of this surfaces in a purpose-built analytics platform. Surgeons and administrators get a real-time OR command center that tracks live procedure progress, an interactive timeline view with synchronized video playback alongside structured step events, and a deviation explorer that presents evidence-backed cards with literature context for every flagged issue. The platform also includes a procedure graph visualization that renders the full protocol as a directed graph color-coded by execution status, a skills assessment dashboard that maps 6DoF motion metrics to validated surgical skill frameworks, and full FHIR/EHR export for standards-compliant reports ready for hospital systems. Beyond post-op review, there's a pre-op voice mode that lets surgeons get briefed about a patient through a conversational agent and surgeon-level analytics for tracking individual performance over time. How We Built It The system is composed of two tightly integrated pipelines. On the vision side, raw video first passes through SAM 3 for pixel-level segmentation, then optical flow tracks keypoints across frames while depth models provide spatial context. FoundationPose handles full 6D instrument pose estimation, and MediaPipe recovers surgeon hand joints. Together, these produce per-frame trajectories and motion signals, which are then segmented into discrete surgical strokes using velocity profiling, spectral analysis (SPARC smoothness via FFT), and high-frequency tremor decomposition. From there, bimanual coordination is quantified through cross-correlation of hand velocity vectors, and motion economy is derived from path length ratios in both 2D pixel space and 3D world coordinates. On the reasoning side, Gemini watches the procedure and maps observed actions to protocol steps. A comparator then diffs the observed sequence against the expected SOP graph to detect deviations, and Scite retrieves relevant research snippets to provide evidence-backed context for each flag. The final outputs are structured and exportable as FHIR-compliant surgical reports. We validated the full pipeline on controlled "banana surgery" experiments before moving to medical footage, using them to stress-test segmentation and tracking reliability under controlled conditions. The analytics platform is built with Next.js 14 and Supabase for Postgres-backed storage and real-time subscriptions. The UI uses Tailwind CSS with a custom dark theme designed for clinical environments, ReactFlow for interactive procedure graph visualization, and Recharts for radar and bar chart rendering. Real-time updates in the OR command center are powered by Supabase channel subscriptions on observed events and procedure run tables. Challenges We Ran Into Surgical video is inherently messy. Frequent occlusions from hands and instruments, rapid lighting changes, constant camera movement from the first-person POV, and long-duration procedures with shifting visual context all make stable tracking extremely difficult. Maintaining consistent segmentation and pose estimation across an entire case required careful orchestration of multiple models working in concert. A deeper challenge was translating low-level motion data into clinically meaningful feedback. Surgeons want to know whether a safety-critical step was skipped and what the literature says about it. Bridging raw computer vision outputs with protocol-aware reasoning in a way that produces actionable, interpretable reports was essential to making the system useful in practice. Accomplishments We're Proud Of We built a complete end-to-end system that takes raw smart-glasses video and produces FHIR-compliant surgical reports, integrating segmentation, 6DoF pose estimation, and stroke-level motion analysis into a single cohesive pipeline. On the platform side, we designed a real-time OR dashboard with structured protocol tracking and implemented deviation detection backed by live literature retrieval. Most importantly, we created an interface that surgeons can actually review in minutes rather than hours. VIPER turns surgery into structured data and makes that data usable. What We Learned The immediate value is improved compliance and reduced error. Hospitals can save an estimated $2.5M–$3.6M annually. But the long-term opportunity is even larger. Robotics companies need high-quality, timestamped, stroke-level surgical motion data to train autonomous systems. Just as dashcams became foundational training data for self-driving cars, structured surgical video at scale becomes the training substrate for surgical robotics. What's Next for VIPER We're expanding to more procedure types and tightening the deviation-to-citation pipeline to make reports even more actionable. From there, we plan to launch pilot integrations with hospital systems and build out longitudinal surgeon performance analytics for credentialing and training feedback. Long term, every surgery generates a structured, auditable, ML-ready record, improving patient safety today and enabling surgical autonomy tomorrow. Credentials for Website Email: surgeon@viper.com Password: viper26!
treehacks-2026
Devpost https://devpost.com/software/viper-3dr107#updates
VIPER is an AI platform that watches first-person surgical video (via smart glasses) and extracts detailed spatial data like instrument tracking, pose estimation, hand positions, and surgical stroke segmentation, then reasons over it to map actions to protocols and flag deviations backed by literature. Everything surfaces through an analytics platform with live OR tracking, interactive timelines, deviation cards, protocol graphs, skills dashboards, EHR export, and a pre-op voice briefing mode, so it's essentially an AI system that watches surgery happen and tells you, in real time and after the fact, what went right, what didn't, and why.
Setup (including FoundationPose)
This repo uses FoundationPose (NVlabs 6D pose estimation) as a Git submodule.
First-time clone (get everything in one step):
git clone --recurse-submodules https://github.com/YOUR_USERNAME/treehacks-2026.git
If you already cloned without submodules:
git submodule update --init --recursive
Then follow FoundationPose’s own setup (Docker or conda, weights, etc.) inside FoundationPose/ — see FoundationPose/readme.md.
RTX 5090 / Blackwell (sm_120): Use the fp5090 conda env (Python 3.11 + PyTorch nightly cu128). From repo root: conda activate fp5090, then cd FoundationPose && python run_demo.py. The demo uses a Python fallback for rotation clustering by default to avoid a C++ extension crash on this setup.
Analysis
View
Metric
- 24
- 4
- 3
- 2
- 2
- 1
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CSSIn code
- FastAPIIn code
- Hugging FaceIn code
- Next.jsIn code
- PythonIn code
- PyTorchIn code
- ReactIn code
- SQLIn code
- SupabaseIn code
- Tailwind CSSIn code
- TypeScriptIn code
- Google GeminiClaimed
- VercelClaimed
11 of 13 appear in the indexed code. 2 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
- CursorCommits
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
485 KB
Source files
87
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
kkaura28/treehacks-2026
4,000 files · 1245.8 MB · @ 1736c6b
Structure
Interface
20 files · 1%Screens, components and styles rendered to the user.
API & routing
1 file · 0%Request entry points: routes, handlers and controllers.
Application logic
823 files · 21%Domain rules, services and shared utilities.
+4 more
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- Python52%
- TypeScript45%
- Markdown2%
- CSS1%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
Analytics_UI/package.json
npm · 20- @elevenlabs/react
- @supabase/supabase-js
- @tailwindcss/postcss
- @types/node
- @types/react
- @types/react-dom
- @xyflow/react
- autoprefixer
- class-variance-authority
- clsx
- geist
- lucide-react
- next
- postcss
- react
- react-dom
- recharts
- tailwind-merge
- +2 more
ScitePipeline/requirements.txt
pypi · 10- fastapi
- google-genai
- httpx
- pydantic
- pydantic-settings
- python-dotenv
- supabase
- torch
- transformers
- uvicorn
FHIR_Generation/requirements.txt
pypi · 3- fastapi
- pydantic
- uvicorn
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This repository has more files than are indexed here, so the diagram and browser show a partial tree. Open it on GitHub for the complete structure.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.