How gokzz-glitch/chakramodel works
ChakraModel is a research framework for colonoscopy polyp segmentation, with video analysis as its user-facing workflow: upload a video, run inference and tracking, optionally stabilize detections, then present annotated video and clinical reporting. Its broader product includes model training, transformer segmentation, uncertainty calibration, temporal/foundation-model experiments, and evaluation. Edges are limited to relationships shown in excerpts, the source index, or README; several documented subsystems are represented without speculative implementation links.
Main entry points: pipeline.py VST-FP pipeline · infer_stream.py Stream inference · evaluate_all.py Model evaluation · eval_pipeline.py Detection evaluation
Components 25
Video analysis
- Analysis dashboard
src/app.py - Stream inference
src/infer_stream.py - Clinical report
src/clinical_report.py - YOLO video app
app.py
Segmentation models
- PraNet segmenter
src/pranet_segmenter.py - Paris classifier
src/paris_classifier.py - Transformer segmenter
src/chakra_transformer/transformer_segmenter.py - VST-FP pipeline
src/vst_fp/pipeline.py - Temporal proposer
src/vst_fp/temporal_proposer.py - SAM2 integration
src/vst_fp/sam2_integration.py
Safety and verification
- Persistence filter
temporal_persistence.py - Conformal calibration
src/conformal_calibration.py - Topological loss
src/topo_loss.py - Topology verifier
src/vst_fp/topological_verifier.py - Evidential decisions
src/vst_fp/evidential_layer.py - Temporal persistence
src/temporal/persistence.py
Training and evaluation
- Combo training
src/run_all_combos.py - Transformer training
src/chakra_transformer/train_transformer.py - Model evaluation
evaluate_all.py - Detection evaluation
src/eval_pipeline.py - Segmentation metrics
src/metrics/seg_metrics.py - ARS metric
src/metrics/ars.py - TCS metric
src/metrics/tcs.py
Web showcase
- Interactive showcase
frontend/src/App.jsx
Other components
- Video user
Connections 21
- Video user → Analysis dashboard: uploads video
src/app.py - Analysis dashboard → Stream inference: runs analysis
src/app.py - Stream inference → PraNet segmenter: refines masks
src/infer_stream.py - Stream inference → Paris classifier: classifies polyps
src/infer_stream.py - Stream inference → Clinical report: generates report
src/infer_stream.py - Video user → YOLO video app: submits video
app.py - YOLO video app → Persistence filter: filters detections
app.py - Combo training → Topological loss: adds topology loss
README.md - Transformer training → Transformer segmenter: trains
src/chakra_transformer/train_transformer.py - Transformer training → Segmentation metrics: measures scores
src/chakra_transformer/train_transformer.py - Conformal calibration → PraNet segmenter: calibrates model
src/conformal_calibration.py - VST-FP pipeline → Temporal proposer: generates prompts
src/vst_fp/pipeline.py - VST-FP pipeline → SAM2 integration: segments video
src/vst_fp/pipeline.py - VST-FP pipeline → Topology verifier: verifies masks
src/vst_fp/pipeline.py - VST-FP pipeline → Evidential decisions: estimates uncertainty
src/vst_fp/pipeline.py - Detection evaluation → ARS metric: computes metric
src/eval_pipeline.py - Detection evaluation → TCS metric: computes metric
src/eval_pipeline.py - Detection evaluation → Temporal persistence: uses temporal state
src/eval_pipeline.py - Model evaluation → Segmentation metrics: evaluates models
evaluate_all.py - Model evaluation → PraNet segmenter: evaluates model
evaluate_all.py - Model evaluation → Transformer segmenter: evaluates model
evaluate_all.py