dcavadia commited on
Commit
b2a9ce9
Β·
1 Parent(s): 00a4891

update streamlit

Browse files
Files changed (2) hide show
  1. app.py +112 -82
  2. requirements.txt +1 -2
app.py CHANGED
@@ -1,86 +1,116 @@
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
-
53
- ---
54
-
55
- βš•οΈ **Medical Disclaimer**: *Research prototype under clinical validation - not intended for diagnostic use.*
56
- """
57
-
58
- # Create interface using Gradio 3.x syntax
59
- with gr.Blocks(title="EndoSight AI") as demo:
60
- gr.Markdown(f"# {title}")
61
- gr.Markdown(description)
62
-
63
- # Video component (simpler syntax for v3.x)
64
- with gr.Row():
65
- video = gr.Video(
66
- value="demo_video.mp4",
67
- label="EndoSight AI Real-time Detection & Segmentation"
68
- )
69
-
70
- with gr.Row():
71
- gr.Markdown("""
72
- ### πŸ” What You're Seeing:
73
- - **Blue bounding boxes**: Real-time polyp detection
74
- - **Colored masks**: Precise segmentation boundaries
75
- - **Measurement overlays**: Automated size calculations
76
- - **Processing metrics**: FPS and accuracy indicators
77
- - **Multi-polyp detection**: Simultaneous analysis capability
78
- """)
79
-
80
- gr.Markdown(footer)
81
-
82
- return demo
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
 
84
  if __name__ == "__main__":
85
- demo = create_demo()
86
- demo.launch()
 
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()
 
requirements.txt CHANGED
@@ -1,2 +1 @@
1
- gradio==3.50.2
2
- websockets
 
1
+ streamlit