Week 3 (Jun 16 - Jun 22)
Meeting with Mentors
In this week’s meeting, I began by sharing an update on my current progress. The mentors gave positive feedback and helped clarify the utility functions used in torch.py
for segmentation. David recommended moving some of these utilities to a shared torch_utils.py
, as they are commonly used across both modules.
We also discussed the next set of deliverables and finalized this week’s goals. Sergio raised a thoughtful question about our choice of Streamlit for the UI. He suggested exploring Gradio too as an alternative, especially since it is part of hugging face we would have better support. Based on this, I decided to compare both frameworks and evaluate which suits our needs better.
To-Do for the Week
- Finish support for Torch image detection models
- Add metrics for detection model evaluation
- Create an example notebook for detection metrics evaluation using COCO and Torch models
- Compare Streamlit and Gradio for building the user interface
Progress
-
I began by finishing the
TorchImageDetectionModel
class where I implemented theinference()
,eval()
, andcomputation_cost()
methods for Torch-based object detection models. -
For detection metrics, I chose to define a new class, instead of extending the existing
MetricsFactory
meant for segmentation. I added aDetectionMetricsFactory
indetection_metrics.py
.
It computes per-class metrics (AP, Precision, Recall, TP, FP and FN) and returns them in a pandas DataFrame. As the last row I have also included mAP in the data frame before returning it. It should look like so :

-
I started creating a sample notebook to test my changes using COCO and a Torch model. Since this is the first time I am running my new changes end-to-end, I was facing minor errors. I started debugging each one and made the necessary changes to the classes. I am currently stuck with an error with respect to the indices mismatching between coco and torch. I will take the mentors help with this in the meeting today.
-
Simultaneously, I began comparing Gradio and Streamlit to help decide which framework to use for our UI. I have listed down the pros and cons for each below.
Gradio Pros - Built-in Hosting & Sharing (Gradio Hub, HF Spaces) - Easy Jupyter Notebook Integration - Seamless Hugging Face, PyTorch, TensorFlow, sklearn integration - Clean UI for Inputs/Outputs - Embeddable in websites via `iframe` Cons - Limited Layout Customization - Multi-page support is basic - No Built-in Session State - Not suitable for dashboards or long-running processes - Limited styling/theming support Streamlit Pros - Ideal for Dashboards, Visualizations, Analytics - Native Multi-page App Support - Advanced Layouts (columns, tabs, sidebars) - Built-in Session State - Broad widget & charting support (Altair, Plotly, etc.) - Better for scalable, real-time apps Cons - Slightly higher learning curve - No one-click public sharing from notebooks - Not embeddable in Jupyter - No native model integration (manual setup needed)
These are the blogs I referred to uibakery.io blog, usro.net blog and myscale.com blog
What’s Next?
For the upcoming week, I’ll work on testing my code changes end-to-end. Fix any errors I face along the way. I will aim to finish the example notebook I started working on. And based on the suggestion from the mentors regarding which UI framework to use, I’ll also start prototyping the user interface.
Enjoy Reading This Article?
Here are some more articles you might like to read next: