All things related to vision ๐
TODO: Combine detection and depth
YOLOv5 with custom training to detect trash
See train_trash_detection.ipynb
for training
Datasets used for training:
Clone YOLOv5 inside ml-ady-vision
git clone https://github.com/ultralytics/yolov5
Go into the yolov5
folder
cd yolov5
Install requirements
pip install -r requirements.txt
Run inference
python detect.py --source "../input/trash.jpg" --weights "../detection_weights.pt" --img-size 640 --conf 0.675 --exist-ok --project ../ --name output
Export ONNX-model
python models/export.py --weights "../detection_weights.pt" --img 640 --batch 1
AdaBins with pretrained models to estimate depth map
Datasets used for training:
Install CUDA (tested on 10.2)
Install cuDNN (tested on 8.0.5 for CUDA 10.2)
Install Anaconda
Create virtual environment (tested on python 3.6.6)
conda create -n vision python=3.6.6 anaconda
Install PyTorch (tested on 1.7.0 and 1.7.1)
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch
See get started if not following previous recommendations, as you may want another version of PyTorch.
Install Taqaddum
conda install -c conda-forge tqdm
Run the setup
setup_depth.sh
Place pretrained weights in pretrained/
Test depth inference
python depth.py