Spaces:
Sleeping
Sleeping
dcavadia commited on
Commit Β·
b2a9ce9
1
Parent(s): 00a4891
update streamlit
Browse files- app.py +112 -82
- requirements.txt +1 -2
app.py
CHANGED
|
@@ -1,86 +1,116 @@
|
|
| 1 |
-
import
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
|
| 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 |
-
|
| 35 |
-
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
#
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
##
|
| 50 |
-
|
| 51 |
-
**
|
| 52 |
-
|
| 53 |
-
--
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
""
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
if __name__ == "__main__":
|
| 85 |
-
|
| 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 |
-
|
| 2 |
-
websockets
|
|
|
|
| 1 |
+
streamlit
|
|
|