import gradio as gr def create_demo(): title = "🔬 EndoSight AI - Development Preview" description = """ ## Advanced Gastrointestinal Polyp Detection & Analysis System **Performance Metrics:** - **88% mAP\\@0.5** detection accuracy - **75.6% Dice Score** segmentation accuracy - **35+ FPS** real-time processing - **YOLOv8 + U-Net** dual architecture with intelligent stabilization ### 🏥 Clinical Capabilities - Real-time polyp detection and localization with smooth tracking - Precise boundary segmentation with fluid heatmap visualization - Intelligent measurement system with anti-fluctuation technology - Automated size classification and risk assessment - Optimized for endoscopy workflow integration ### 🎯 Technical Highlights - **Multi-modal AI**: Combined object detection and segmentation - **Clinical-grade performance**: Sub-second processing times - **Intelligent measurement**: Size, area, and morphometric analysis with temporal stabilization - **Adaptive visualization**: Real-time heatmaps that adjust to camera movement - **Real-time inference**: GPU-accelerated deployment ready --- ## 🎥 Live System Demonstration **Real-time EndoSight AI in action** - showcasing automated polyp detection, intelligent segmentation, stabilized measurement analysis, and clinical classification on endoscopy footage. """ footer = """ --- ## 🚀 Development Status & Impact ✅ **Model Training**: Complete with validation metrics achieved 🔄 **Clinical Integration**: Active collaboration with gastroenterology clinic 📊 **Performance**: Production-ready accuracy and speed benchmarks 🎯 **Target**: Characterization of neoplastic versus non-neoplastic lesions ### 🤝 Research Collaboration **Alumnus of**: Universidad Central de Venezuela **Research Focus**: AI-Assisted Endoscopy & Computer-Aided Diagnosis ### 📞 Professional Contact **Technical Lead**: Daniel Cavadia **Email**: [dan.cavadia@gmail.com](mailto:dan.cavadia@gmail.com) --- ⚕️ **Medical Disclaimer**: *Research prototype under clinical validation - not intended for diagnostic use.* """ # Create simple interface using Gradio 3.34.0 syntax with gr.Blocks(title="EndoSight AI") as demo: gr.Markdown(f"# {title}") gr.Markdown(description) # Simple video display (no fancy features in older version) video = gr.Video( value="demo_video.mp4", label="EndoSight AI Real-time Detection & Segmentation with Intelligent Measurements" ) gr.Markdown(""" ### 🔍 What You're Seeing: - **Yellow bounding boxes**: Real-time polyp detection with smooth tracking - **Fluid heatmaps**: Dynamic segmentation visualization that adapts to movement - **Bottom-left panels**: Stabilized measurement displays with clinical classifications - **Size categories**: Diminutive (<5mm), Small (5-9mm), Large (≥10mm) classifications - **Risk assessment**: Low/Moderate/High risk indicators based on polyp size - **Measurement accuracy**: Diameter and area calculations with error margins - **Anti-fluctuation**: Intelligent system prevents measurement swings during camera movement - **Processing metrics**: Real-time FPS and confidence indicators - **Multi-polyp detection**: Simultaneous analysis capability with unique tracking IDs """) gr.Markdown(footer) return demo if __name__ == "__main__": demo = create_demo() demo.launch()