Week 1 (Jun 01 - Jun 08)
Meeting with Mentors
This week, we discussed the implementation plan in more detail. David suggested that I start with refactoring the dataset.py
module as a solid entry point into the codebase. Once that is complete, I can gradually move on to refactoring the model class and metrics module.
They also encouraged me to open a draft PR early so that my progress can be continuously reviewed and improved. David also mentioned an exciting use case for our tool: it will be used to evaluate a trash detection model, making the detection metrics we build directly impactful.
This Week’s To-Do
- Refactor dataset.py
- Refactor model.py
- Explore Streamlit (if time permits)
Progress
I started this week by refactoring the dataset classes. I followed the structure David and I had discussed during the application stage.
The older class structure looked like this:

To support detection models more effectively, I’ve reorganized the class hierarchy:

I began by identifying the common functionalities shared between segmentation and detection tasks. These were moved into a new base class, PerceptionDataset
. In this class, I’ve implemented methods like: __init__
, __len__
, make_fname_global
and append
(assuming the ontology structure is the same as segmentation for now)
If there is some extra info per class in the datasets, the logic in append
can be overridden later in the DetectionDataset
class.
Next, I defined the functions specific to segmentation and detection within their respective subclasses. I also incorporated some of the model refactoring work I had prepared during the application phase and finished up the changes.
I’ve raised a draft PR that includes all these changes. Following David’s suggestion, I split the monolithic class into multiple files to improve modularity and maintainability.

Going ahead
I plan to thoroughly test all the changes I have made. If everything is alright I am thinking defining coco.py and pascalvoc.py could be a potential next step. I also didn’t get much time to explore streamlit this week, hoping to do that as well this coming week.
Enjoy Reading This Article?
Here are some more articles you might like to read next: