iBrokeTheCode commited on
Commit
3f6eee9
Β·
1 Parent(s): de71074

chore: Add tabs about project details

Browse files
Files changed (2) hide show
  1. src/assets/architecture.jpg +3 -0
  2. src/streamlit_app.py +57 -27
src/assets/architecture.jpg ADDED

Git LFS Details

  • SHA256: f9fd898a5ae5f124f5ed987b774564141b90d9e80e18d2d7e3e5cb32cd1b684e
  • Pointer size: 130 Bytes
  • Size of remote file: 45 kB
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, tab_description = st.tabs(["**App**", "**Description**"])
 
 
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
- # πŸ“Œ DESCRIPTION TAB
144
- with tab_description:
145
- st.header("About This Project", divider=True)
146
- st.markdown(
147
- """
148
- This project showcases a Convolutional Neural Network (CNN) model that automatically
149
- classifies images into over 1000 different categories.
150
-
151
- ### Original Architecture
152
- The original project was built as a multi-service architecture, featuring:
153
- * **Streamlit:** For the web user interface.
154
- * **FastAPI:** As a RESTful API to handle image processing and model serving.
155
- * **Redis:** A message broker for communication between the services.
156
-
157
- ### Portfolio Adaptation
158
- For a live and cost-effective demo, this application has been adapted into a single-service
159
- solution. The core logic of the FastAPI backend has been integrated directly into
160
- the Streamlit app. This demonstrates the ability to adapt a solution for
161
- specific deployment and resource constraints.
162
-
163
- ### Technologies Used
164
- * **Streamlit:** For the interactive web interface.
165
- * **TensorFlow:** For loading and running the pre-trained CNN model.
166
- * **Pre-trained Model:** ResNet50 with weights trained on the ImageNet dataset.
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
+ )