This repository trains the resnet152 model to predict manhole covers in 13 different classes:
- Rost/Strassenrost
- Vollguss/Pickelloch belueftet
- Gussbeton/Pickelloch geschlossen
- Vollguss/Pickelloch geschlossen
- Gussbeton/Pickelloch belueftet
- Vollguss/Handgriff geschlossen
- Gussbeton/Handgriff seitlich
- Rost/Einlauf rund
- Rost/Strassenrost gewoelbt
- Vollguss/Aufklappbar
- Gussbeton/Handgriff mitte
- Vollguss/Handgriff geschlossen, verschraubt
- Andere/-
- Clone project locally
git clone git@github.com:FiratSaritas/manhole-cover-retrainer.git
-
Take the images from the repository manhole-cover-labelling from the folder ./data/images_transformed and added it to the folder ./data/images_transformed in this repository.
-
Take the labels.csv file that was created by repository manhole-cover-labelling in the folder ./data/ and rename it to "new_labels.csv" and add it to the folder ./data/ in that repository.
-
Download old Images
Download images as Folder (images_transformed) from Google Drive and add it to the folder ./images_transformed here: (https://drive.google.com/drive/folders/1y5T1-WUZB1Vsp87aBiU6hDxagiY2mGgi?usp=sharing)
- Install required packages
create a new enviorment with conda.
conda create --name retrainer
activate retrainer
Install Cuda:
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
pip install -r requirements.txt
- run the code:
python retrainer.py
Output:
- When you have trained the model, you get a .pth file
model.pth
- You can now replace this model with the old model in the repository manhole-cover-model
This is a continuation of the repository manhole-cover-classification and the actual work was created on the other repository.