detectron2 https://github.com/facebookresearch/detectron2
YOLOv5 https://github.com/ultralytics/yolov5
DETR https://github.com/facebookresearch/detr
Install Microsoft C++ Build Tools https://visualstudio.microsoft.com/visual-cpp-build-tools/
Install Instructions https://stackoverflow.com/a/64262038
Don't forget to restart your system
Install Miniconda from https://docs.conda.io/en/latest/miniconda.html
Please create a conda environment to make installation easier
conda create --name waste python=3.9 -y
conda activate waste
Always make sure pip is up to date
pip install --upgrade pip
Depending on the version of CUDA that is required the pytorch installation will vary. Change cudatoolkit=11.3 to 10.2 if CUDA 11.3 is not supported on your GPU
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch -y
pip install opencv-python
python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
conda install pywin32 -y
cd YOLOV5
pip install -r requirements.txt
pip install wandb
cd ..
conda install cython scipy -y
cd YOLOV5
python train.py --img 640 --batch 16 --data trash_9.yaml --weights yolov5m.pt --hyp hyp.scratch-low_trash.yaml
OR
python train.py --img <dimensions> --batch <batch_size recc. 64> --data <yaml for dataset> --weights yolov5m.pt --hyp <customised hyperparameters>
Finally, test the model
python val.py --img 640 --batch 32 --data trash_9.yaml --weights ./runs/train/<exp#>/weights/best.pt --task test --device 0
cd FRCNN_DETR
# Linux
./frcnn_1_gpu.sh (assuming the current dataset is being used)
# All
python train.py --type ('frcnn' or 'detr') --num-gpus=1 SOLVER.IMS_PER_BATCH <batch_size> SOLVER.BASE_LR <learning rate>
OR FOR MULTI-GPU
# Linux
./frcnn_4_gpu.sh
./detr_4_gpu.sh
# ALL
python train.py --type ('frcnn' or 'detr') --num-gpus=4 SOLVER.IMS_PER_BATCH <total_batch_size> SOLVER.BASE_LR <learning rate>
TrashNet (annotated newly with bounding boxes): https://github.com/garythung/trashnet
TACO (annotated newly once again): http://tacodataset.org/
UAVVaste (mapped to correct classes): https://uavvaste.github.io/
There are 9 classes.
- aluminium wrap
- cardboard
- cigarette
- general waste
- glass
- metal
- paper
- plastic
- styrofoam
Please submit annotations in the COCO Format
The annotation type is "1. Object Detection" on the same page.
If an object is made of thin cardboard (between paper and cardboard), opt for 'paper'.
If you can't tell whether an object is a certain material, opt for 'general waste'.
When annotating an image, be sure to make the bounding box as small as possible.
The current best performance was achieved by using a combination of TACO, TrashNet and UAVVaste.
The dataset split used was:
- Total images: 6460
- Train: ~4500 images (70%)
- Validation: 654 images (10%)
- Test: ~1300 images (20%)
- mAP: 51.3%
- Precision: 62.4%
- Recall: 49.1%