Commit
Β·
3f6eee9
1
Parent(s):
de71074
chore: Add tabs about project details
Browse files- src/assets/architecture.jpg +3 -0
- src/streamlit_app.py +57 -27
src/assets/architecture.jpg
ADDED
|
Git LFS Details
|
src/streamlit_app.py
CHANGED
|
@@ -14,6 +14,7 @@ st.html("""
|
|
| 14 |
<style>
|
| 15 |
.stMainBlockContainer {
|
| 16 |
max-width: 70rem;
|
|
|
|
| 17 |
}
|
| 18 |
</style>
|
| 19 |
""")
|
|
@@ -35,7 +36,9 @@ with st.container():
|
|
| 35 |
st.html("<br>")
|
| 36 |
|
| 37 |
# Use tabs for different sections of the app
|
| 38 |
-
tab_app,
|
|
|
|
|
|
|
| 39 |
|
| 40 |
# π APP TAB
|
| 41 |
with tab_app:
|
|
@@ -140,29 +143,56 @@ with st.container():
|
|
| 140 |
st.info("Click 'Classify Image' to see the prediction.")
|
| 141 |
|
| 142 |
|
| 143 |
-
# π
|
| 144 |
-
with
|
| 145 |
-
st.header("About This Project"
|
| 146 |
-
st.markdown(
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
<style>
|
| 15 |
.stMainBlockContainer {
|
| 16 |
max-width: 70rem;
|
| 17 |
+
padding-bottom: 1rem;
|
| 18 |
}
|
| 19 |
</style>
|
| 20 |
""")
|
|
|
|
| 36 |
st.html("<br>")
|
| 37 |
|
| 38 |
# Use tabs for different sections of the app
|
| 39 |
+
tab_app, tab_about, tab_architecture = st.tabs(
|
| 40 |
+
["**App**", "**About**", "**Architecture**"]
|
| 41 |
+
)
|
| 42 |
|
| 43 |
# π APP TAB
|
| 44 |
with tab_app:
|
|
|
|
| 143 |
st.info("Click 'Classify Image' to see the prediction.")
|
| 144 |
|
| 145 |
|
| 146 |
+
# π ABOUT TAB
|
| 147 |
+
with tab_about:
|
| 148 |
+
st.header("About This Project")
|
| 149 |
+
st.markdown("""
|
| 150 |
+
- This project is an **image classification app** powered by a Convolutional Neural Network (CNN).
|
| 151 |
+
- Simply upload an image, and the app predicts its category from **over 1,000 classes** using a pre-trained **ResNet50** model.
|
| 152 |
+
- Originally developed as a **multi-service ML system** (FastAPI + Redis + Streamlit), this version has been **adapted into a single Streamlit app** for lightweight, cost-effective deployment on Hugging Face Spaces.
|
| 153 |
+
|
| 154 |
+
### Model & Description
|
| 155 |
+
- **Model:** ResNet50 (pre-trained on the **ImageNet** dataset with 1,000+ categories).
|
| 156 |
+
- **Pipeline:** Images are resized, normalized, and passed to the model.
|
| 157 |
+
- **Output:** The app displays the **Top prediction** with confidence score.
|
| 158 |
+
|
| 159 |
+
[ResNet50](https://www.tensorflow.org/api_docs/python/tf/keras/applications/ResNet50) is widely used in both research and production, making it an excellent showcase of deep learning capabilities and transferable ML skills.
|
| 160 |
+
""")
|
| 161 |
+
|
| 162 |
+
with tab_architecture:
|
| 163 |
+
with st.expander("π οΈ View Original System Architecture"):
|
| 164 |
+
st.image(
|
| 165 |
+
image="./src/assets/architecture.jpg",
|
| 166 |
+
caption="Original Microservices Architecture",
|
| 167 |
+
)
|
| 168 |
+
|
| 169 |
+
st.markdown("""
|
| 170 |
+
### Original Architecture
|
| 171 |
+
- **FastAPI** β REST API for image processing
|
| 172 |
+
- **Redis** β Message broker for service communication
|
| 173 |
+
- **Streamlit** β Interactive web UI
|
| 174 |
+
- **TensorFlow** β Deep learning inference engine
|
| 175 |
+
- **Locust** β Load testing & benchmarking
|
| 176 |
+
- **Docker Compose** β Service orchestration
|
| 177 |
+
|
| 178 |
+
### Simplified Version
|
| 179 |
+
- **Streamlit only** β UI and model combined in a single app
|
| 180 |
+
- **TensorFlow (ResNet50)** β Core prediction engine
|
| 181 |
+
- **Docker** β Containerized for Hugging Face Spaces deployment
|
| 182 |
+
|
| 183 |
+
This evolution demonstrates the ability to design a **scalable microservices system** and also **adapt it into a lightweight single-service solution** for cost-effective demos.
|
| 184 |
+
""")
|
| 185 |
+
|
| 186 |
+
|
| 187 |
+
# π FOOTER
|
| 188 |
+
st.divider()
|
| 189 |
+
st.markdown(
|
| 190 |
+
"""
|
| 191 |
+
<div style="text-align: center; margin-bottom: 1.5rem;">
|
| 192 |
+
<b>Connect with me:</b> πΌ <a href="https://www.linkedin.com/in/alex-turpo/" target="_blank">LinkedIn</a> β’
|
| 193 |
+
π± <a href="https://github.com/iBrokeTheCode" target="_blank">GitHub</a> β’
|
| 194 |
+
π€ <a href="https://huggingface.co/iBrokeTheCode" target="_blank">Hugging Face</a>
|
| 195 |
+
</div>
|
| 196 |
+
""",
|
| 197 |
+
unsafe_allow_html=True,
|
| 198 |
+
)
|