dcavadia commited on
Commit
cb9512d
Β·
1 Parent(s): 50f40be

update app

Browse files
Files changed (1) hide show
  1. app.py +74 -103
app.py CHANGED
@@ -1,137 +1,108 @@
1
  import gradio as gr
2
 
3
- def create_endosight_demo():
4
- # Project description and information
5
- project_info = """
6
- # πŸ”¬ EndoSight AI - Development Preview
7
 
8
- **Advanced Gastrointestinal Polyp Detection & Analysis System**
 
9
 
10
- EndoSight AI combines YOLOv8 object detection with U-Net segmentation to provide:
11
- - **Real-time polyp detection** at 35+ FPS
12
- - **Precise boundary segmentation** with 92% pixel accuracy
13
- - **Quantitative size measurement** for clinical decision support
14
- - **88% mAP@0.5 detection accuracy** on validation datasets
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
  ---
17
 
18
- ## 🎯 Key Capabilities
19
- - **Multi-modal AI Architecture**: YOLOv8-UNet pipeline
20
- - **Clinical Integration**: Real-time processing for endoscopy workflows
21
- - **Quantitative Analysis**: Automated polyp measurement and morphometry
22
- - **High Performance**: GPU-optimized for clinical deployment
23
 
24
- ## πŸ₯ Clinical Impact
25
- This system enables gastroenterologists to:
26
- - Detect polyps with higher accuracy and consistency
27
- - Obtain precise measurements for treatment planning
28
- - Reduce procedure time through automated analysis
29
- - Improve early detection of potentially malignant lesions
30
 
 
31
  ---
32
 
33
- ### πŸ“Š Performance Metrics
34
- - **Detection Accuracy**: 88% mAP@0.5
35
- - **Segmentation Accuracy**: 92% pixel-level precision
36
- - **Processing Speed**: 35+ FPS real-time analysis
37
- - **Model Size**: Optimized for clinical deployment
 
38
 
39
- ### πŸ”§ Technical Stack
40
- - **Detection**: YOLOv8 (Ultralytics)
41
- - **Segmentation**: U-Net Architecture
42
- - **Framework**: PyTorch, OpenCV
43
- - **Deployment**: Docker, FastAPI backend
 
 
 
 
44
 
45
  ---
46
 
47
- ## πŸ“Ή Live Demo Preview
48
 
49
- **Note**: This is a development preview. The video below demonstrates EndoSight AI's real-time detection and segmentation capabilities on sample endoscopy footage.
 
 
 
 
50
 
51
- *Full interactive demo coming soon with model deployment.*
52
- """
53
 
54
- # Create the interface using Blocks for more control
 
 
55
  with gr.Blocks(
56
- title="EndoSight AI - Gastrointestinal Polyp Detection System",
57
  theme=gr.themes.Soft(),
58
- css="""
59
- .gradio-container {
60
- max-width: 900px !important;
61
- margin: auto;
62
- }
63
- .video-container {
64
- border: 2px solid #e1e5e9;
65
- border-radius: 10px;
66
- padding: 20px;
67
- margin: 20px 0;
68
- }
69
- """
70
  ) as demo:
71
 
72
- # Header and description
73
- gr.Markdown(project_info)
74
 
75
- # Video demonstration section
76
  with gr.Row():
77
  with gr.Column():
78
- gr.Markdown("### πŸŽ₯ System Demonstration")
79
-
80
- # Video component - you'll need to upload your video file to the Space
81
- video_demo = gr.Video(
82
- value="demo_video.mp4", # Replace with your video filename
83
- label="EndoSight AI Detection Demo",
 
84
  show_label=True,
85
- height=400,
86
- width=600,
87
- interactive=False
88
  )
89
-
 
 
90
  gr.Markdown("""
91
- **Demo Features Shown:**
92
- - Real-time polyp detection with bounding boxes
93
- - Precise segmentation masks overlaid on video
94
- - Quantitative measurements displayed in real-time
95
- - Multi-polyp detection in single frame
96
- - Processing speed and accuracy metrics
97
  """)
98
 
99
- # Contact and development status
100
- with gr.Row():
101
- gr.Markdown("""
102
- ---
103
-
104
- ## πŸš€ Development Status
105
-
106
- **Current Phase**: Model Training & Validation βœ…
107
- **Next Phase**: Clinical Integration & Testing
108
- **Target Release**: Q1 2026
109
-
110
- ### πŸ“ž Collaboration & Contact
111
-
112
- EndoSight AI is developed in collaboration with:
113
- - **Academic Partner**: Universidad Central de Venezuela
114
- - **Clinical Partner**: Private Gastroenterology Clinic
115
- - **Research Focus**: AI-Assisted Endoscopy
116
-
117
- For technical inquiries, collaboration opportunities, or clinical trial participation:
118
- **Contact**: [Your Professional Email]
119
- **LinkedIn**: [Your LinkedIn Profile]
120
- **GitHub**: [Repository Link]
121
-
122
- ---
123
-
124
- ### βš•οΈ Medical Disclaimer
125
- *EndoSight AI is a research prototype under development. Not intended for clinical diagnosis. Always consult qualified medical professionals for medical decisions.*
126
- """)
127
 
128
  return demo
129
 
130
- # Launch the demo
131
  if __name__ == "__main__":
132
- demo = create_endosight_demo()
133
- demo.launch(
134
- server_name="0.0.0.0",
135
- server_port=7860,
136
- share=False
137
- )
 
1
  import gradio as gr
2
 
3
+ def create_demo():
4
+ title = "πŸ”¬ EndoSight AI - Development Preview"
 
 
5
 
6
+ description = """
7
+ ## Advanced Gastrointestinal Polyp Detection & Analysis System
8
 
9
+ **Performance Metrics:**
10
+ - **88% mAP@0.5** detection accuracy
11
+ - **92% pixel-level** segmentation accuracy
12
+ - **35+ FPS** real-time processing
13
+ - **YOLOv8 + U-Net** dual architecture
14
+
15
+ ### πŸ₯ Clinical Capabilities
16
+ - Real-time polyp detection and localization
17
+ - Precise boundary segmentation with pixel-level accuracy
18
+ - Quantitative size measurement for clinical decision support
19
+ - Optimized for endoscopy workflow integration
20
+
21
+ ### 🎯 Technical Highlights
22
+ - **Multi-modal AI**: Combined object detection and segmentation
23
+ - **Clinical-grade performance**: Sub-second processing times
24
+ - **Automated measurement**: Size, area, and morphometric analysis
25
+ - **Real-time inference**: GPU-accelerated deployment ready
26
 
27
  ---
28
 
29
+ ## πŸŽ₯ Live System Demonstration
 
 
 
 
30
 
31
+ **Real-time EndoSight AI in action** - showcasing automated polyp detection, segmentation, and measurement analysis on endoscopy footage.
32
+ """
 
 
 
 
33
 
34
+ footer = """
35
  ---
36
 
37
+ ## πŸš€ Development Status & Impact
38
+
39
+ βœ… **Model Training**: Complete with validation metrics achieved
40
+ πŸ”„ **Clinical Integration**: Active collaboration with gastroenterology clinic
41
+ πŸ“Š **Performance**: Production-ready accuracy and speed benchmarks
42
+ 🎯 **Target**: Q1 2026 clinical deployment
43
 
44
+ ### 🀝 Research Collaboration
45
+
46
+ **Academic Partner**: Universidad Central de Venezuela
47
+ **Research Focus**: AI-Assisted Endoscopy & Computer-Aided Diagnosis
48
+
49
+ ### πŸ“ž Professional Contact
50
+
51
+ **Technical Lead**: Daniel Cavadia
52
+ **Email**: dan.cavadia@gmail.com
53
 
54
  ---
55
 
56
+ ### πŸ₯ Clinical Impact Potential
57
 
58
+ EndoSight AI aims to:
59
+ - **Improve detection rates** of early-stage polyps
60
+ - **Reduce procedure time** through automated analysis
61
+ - **Enhance diagnostic consistency** across practitioners
62
+ - **Support clinical decision-making** with quantitative measurements
63
 
64
+ ---
 
65
 
66
+ βš•οΈ **Medical Disclaimer**: *Research prototype under clinical validation - not intended for diagnostic use. Always consult qualified medical professionals for medical decisions.*
67
+ """
68
+
69
  with gr.Blocks(
70
+ title="EndoSight AI - Gastrointestinal Polyp Detection",
71
  theme=gr.themes.Soft(),
 
 
 
 
 
 
 
 
 
 
 
 
72
  ) as demo:
73
 
74
+ gr.Markdown(f"# {title}")
75
+ gr.Markdown(description)
76
 
77
+ # Video section with autoplay and loop (GIF-like behavior)
78
  with gr.Row():
79
  with gr.Column():
80
+ gr.Video(
81
+ value="demo_video.mp4",
82
+ label="EndoSight AI Real-time Detection & Segmentation",
83
+ height=500,
84
+ width=700,
85
+ autoplay=True, # Starts automatically
86
+ loop=True, # Loops like a GIF
87
  show_label=True,
88
+ interactive=False # Users can't control playback
 
 
89
  )
90
+
91
+ with gr.Row():
92
+ with gr.Column():
93
  gr.Markdown("""
94
+ ### πŸ” What You're Seeing:
95
+ - **Blue bounding boxes**: Real-time polyp detection
96
+ - **Colored masks**: Precise segmentation boundaries
97
+ - **Measurement overlays**: Automated size calculations
98
+ - **Processing metrics**: FPS and accuracy indicators
99
+ - **Multi-polyp detection**: Simultaneous analysis capability
100
  """)
101
 
102
+ gr.Markdown(footer)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
 
104
  return demo
105
 
 
106
  if __name__ == "__main__":
107
+ demo = create_demo()
108
+ demo.launch()