dcavadia commited on
Commit
0d8c7b9
Β·
1 Parent(s): b2a9ce9

update gradio

Browse files
Files changed (2) hide show
  1. app.py +83 -112
  2. requirements.txt +1 -1
app.py CHANGED
@@ -1,116 +1,87 @@
1
- import streamlit as st
2
- import base64
3
-
4
- # Configure the page
5
- st.set_page_config(
6
- page_title="EndoSight AI - Gastrointestinal Polyp Detection",
7
- page_icon="πŸ”¬",
8
- layout="wide"
9
- )
10
-
11
- def get_video_html(video_path):
12
- """Create HTML for auto-playing, looping video"""
13
- with open(video_path, "rb") as video_file:
14
- video_bytes = video_file.read()
15
-
16
- video_base64 = base64.b64encode(video_bytes).decode('utf-8')
17
-
18
- video_html = f"""
19
- <video width="100%" height="500" autoplay muted loop controls style="border-radius: 10px; border: 2px solid #e1e5e9;">
20
- <source src="data:video/mp4;base64,{video_base64}" type="video/mp4">
21
- Your browser does not support the video tag.
22
- </video>
23
- """
24
- return video_html
25
-
26
- # Main app
27
- def main():
28
- # Header
29
- st.markdown("# πŸ”¬ EndoSight AI - Development Preview")
30
-
31
- # Description
32
- st.markdown("""
33
- ## Advanced Gastrointestinal Polyp Detection & Analysis System
34
-
35
- **Performance Metrics:**
36
- - **88% mAP@0.5** detection accuracy
37
- - **92% pixel-level** segmentation accuracy
38
- - **35+ FPS** real-time processing
39
- - **YOLOv8 + U-Net** dual architecture
40
-
41
- ### πŸ₯ Clinical Capabilities
42
- - Real-time polyp detection and localization
43
- - Precise boundary segmentation with pixel-level accuracy
44
- - Quantitative size measurement for clinical decision support
45
- - Optimized for endoscopy workflow integration
46
-
47
- ### 🎯 Technical Highlights
48
- - **Multi-modal AI**: Combined object detection and segmentation
49
- - **Clinical-grade performance**: Sub-second processing times
50
- - **Automated measurement**: Size, area, and morphometric analysis
51
- - **Real-time inference**: GPU-accelerated deployment ready
52
-
53
- ---
54
-
55
- ## πŸŽ₯ Live System Demonstration
56
-
57
- **Real-time EndoSight AI in action** - showcasing automated polyp detection, segmentation, and measurement analysis on endoscopy footage.
58
- """)
59
-
60
- # Video section
61
- try:
62
- video_html = get_video_html("demo_video.mp4")
63
- st.markdown(video_html, unsafe_allow_html=True)
64
- except FileNotFoundError:
65
- st.error("Video file not found. Please upload demo_video.mp4 to your Space.")
66
-
67
- # Video description
68
- st.markdown("""
69
- ### πŸ” What You're Seeing:
70
- - **Blue bounding boxes**: Real-time polyp detection
71
- - **Colored masks**: Precise segmentation boundaries
72
- - **Measurement overlays**: Automated size calculations
73
- - **Processing metrics**: FPS and accuracy indicators
74
- - **Multi-polyp detection**: Simultaneous analysis capability
75
- """)
76
-
77
- # Footer
78
- st.markdown("""
79
- ---
80
-
81
- ## πŸš€ Development Status & Impact
82
-
83
- βœ… **Model Training**: Complete with validation metrics achieved
84
- πŸ”„ **Clinical Integration**: Active collaboration with gastroenterology clinic
85
- πŸ“Š **Performance**: Production-ready accuracy and speed benchmarks
86
- 🎯 **Target**: Q1 2026 clinical deployment
87
-
88
- ### 🀝 Research Collaboration
89
-
90
- **Academic Partner**: Universidad Central de Venezuela
91
- **Clinical Partner**: Private Gastroenterology Clinic
92
- **Research Focus**: AI-Assisted Endoscopy & Computer-Aided Diagnosis
93
-
94
- ### πŸ“ž Professional Contact
95
-
96
- **Technical Lead**: Daniel Cavadia
97
- **LinkedIn**: Connect for collaboration opportunities
98
- **Portfolio**: View complete AI/ML project portfolio
99
-
100
- ---
101
-
102
- ### πŸ₯ Clinical Impact Potential
103
-
104
- EndoSight AI aims to:
105
- - **Improve detection rates** of early-stage polyps
106
- - **Reduce procedure time** through automated analysis
107
- - **Enhance diagnostic consistency** across practitioners
108
- - **Support clinical decision-making** with quantitative measurements
109
 
110
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
 
112
- βš•οΈ **Medical Disclaimer**: *Research prototype under clinical validation - not intended for diagnostic use. Always consult qualified medical professionals for medical decisions.*
113
- """)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
 
115
  if __name__ == "__main__":
116
- main()
 
 
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
+ **Clinical Partner**: Private Gastroenterology Clinic
48
+ **Research Focus**: AI-Assisted Endoscopy & Computer-Aided Diagnosis
49
+
50
+ ### πŸ“ž Professional Contact
51
+
52
+ **Technical Lead**: Daniel Cavadia
53
+ **LinkedIn**: Connect for collaboration opportunities
54
+ **Portfolio**: View complete AI/ML project portfolio
55
+
56
+ ---
57
+
58
+ βš•οΈ **Medical Disclaimer**: *Research prototype under clinical validation - not intended for diagnostic use.*
59
+ """
60
+
61
+ # Create simple interface using Gradio 3.34.0 syntax
62
+ with gr.Blocks(title="EndoSight AI") as demo:
63
+ gr.Markdown(f"# {title}")
64
+ gr.Markdown(description)
65
+
66
+ # Simple video display (no fancy features in older version)
67
+ video = gr.Video(
68
+ value="demo_video.mp4",
69
+ label="EndoSight AI Real-time Detection & Segmentation"
70
+ )
71
+
72
+ gr.Markdown("""
73
+ ### πŸ” What You're Seeing:
74
+ - **Blue bounding boxes**: Real-time polyp detection
75
+ - **Colored masks**: Precise segmentation boundaries
76
+ - **Measurement overlays**: Automated size calculations
77
+ - **Processing metrics**: FPS and accuracy indicators
78
+ - **Multi-polyp detection**: Simultaneous analysis capability
79
+ """)
80
+
81
+ gr.Markdown(footer)
82
+
83
+ return demo
84
 
85
  if __name__ == "__main__":
86
+ demo = create_demo()
87
+ demo.launch()
requirements.txt CHANGED
@@ -1 +1 @@
1
- streamlit
 
1
+ gradio==3.34.0