This project focuses on segmenting trash cans in images using deep learning techniques. Two custom models based on the ResUNet architecture were developed:
- Small ResUNet: A lightweight model with fewer parameters, optimized for faster inference and lower resource consumption.
- Large ResUNet: A deeper network with increased capacity, aiming for improved accuracy.
Additionally, a pre-trained ResNet model from PyTorch's torchvision.models was fine-tuned to adapt to the trash can segmentation task, serving as a baseline for comparison.
-
Custom ResUNet Architectures:
- Small Version: Designed for environments with limited computational resources.
- Large Version: Enhanced depth and complexity for higher segmentation accuracy.
-
Transfer Learning:
- Fine-tuning a pre-trained ResNet model to leverage existing feature extraction capabilities for the specific task of trash can segmentation.
-
Clone the Repository:
git clone https://github.com/Micz26/Trash-Can-Segmentation.git cd Trash-Can-Segmentation -
Create a Virtual Environment:
conda create --name trashcan-env python=3.9
-
Activate the Virtual Environment:
conda activate trashcan-env
-
Install Dependencies:
pip install . -
Download and Place the Dataset:
- Download the TrashCan dataset.
- Extract and place the dataset into the
data/directory.
To train and save the model:
python scripts/train_resunet.py-
Build the Docker Image:
docker build -t trashcan-app . -
Run the Docker Container:
docker run -p 8501:8501 trashcan-app
To run the application using Streamlit:
streamlit run src/trashcan_frontend/frontend.pyNote: If you choose to run the application via Streamlit, ensure that you adjust the paths in the following file:
src/trashcan_core/components/constants/file_paths.py