This is a project for garbage dump detection with BCA-Net, which can be used to perform global garbage dump detection with our upcoming multi-category garbage dump dataset.
- OS: Ubuntu 16.04
- GPU: Nvidia GTX/RTX series GPU with proper NVIDIA Driver installed
- Software: Docker installed
-
Create a new project folder.
mkdir /home/$[YOUR_USERNAME]/garbage_dump cd /home/$[YOUR_USERNAME]/garbage_dump
-
Download the code.
git clone https://github.com/DongshuoYin/garbage_dump_detection.git
-
Download dataset in our paper's link.
-
Unzip the dataset to
./garbage_dump_detection/data/
.garbage_dump_detection ├── mmdet ├── tools ├── configs ├── data │ ├── garbage_dump_2022 │ │ ├── VOC2012 │ │ │ ├──train │ │ │ │ ├──Annotations │ │ │ │ ├──JPEGImages │ │ │ │ ├──train.txt │ │ │ ├──test │ │ │ │ ├──Annotations │ │ │ │ ├──JPEGImages │ │ │ │ ├──test.txt ...... ......
-
Get the docker image from Docker-hub.
sudo docker pull y389164605/garbage_dump_detection:latest
-
Create a docker container with the above image.
sudo nvidia-docker run --privileged=true --name=$[YOUR_CONTAINER_NAME] --shm-size=8g -d -p $[PORT_FOR_CONTAINER_PORT_22]:22 -v /home/$[YOUR_USERNAME]/garbage_dump/garbage_dump_detection:/garbage_dump_detection y389164605/garbage_dump_detection:latest /usr/sbin/sshd -D
Note:
a. If the terminal remains inactive, create a new terminal and continue the operation.
b.
/home/$[YOUR_USERNAME]/garbage_dump/garbage_dump_detection
in your computer and/garbage_dump_detection
in your docker container are a pair of mapped folders and they will remain consistent. -
Enter the above docker container.
sudo docker exec -it $[YOUR_CONTAINER_NAME] /bin/bash cd /garbage_dump_detection python setup.py develop
PS: Installation can be completed in about 0.5~1 hour with good internet access.
-
Download the pre-trained model here and put it in
/home/$[YOUR_USERNAME]/garbage_dump/garbage_dump_detection/checkpoint_backup/
-
Run the following code in container.
cd tools python demo.py
PS: Demo can be completed in less than 20 seconds.
-
Download the pre-trained model here (same as Demo) and put it in
/home/$[YOUR_USERNAME]/garbage_dump/garbage_dump_detection/checkpoint_backup/
. -
Resize your images to 1024*1024 pixels.
-
Copy all your images to
/home/$[YOUR_USERNAME]/garbage_dump/garbage_dump_detection/tools/batch_inference_data/
. -
Run the following code in container.
cd tools python inference.py
-
Check your imference results in
/home/$[YOUR_USERNAME]/garbage_dump/garbage_dump_detection/tools/batch_inference_data/inference_visualization
- Run the following code.
cd tools python train.py ../_myconfigs/pascal_voc/faster_rcnn_r50_fpn_1x_voc0712_all_layer_SE_with_ClassBalancedDataset_and_low_nms_score_config_and_data_augumentation.py
- Check the evaluation metric on test set after each epoch.
Note: If you want to train with your own dataset, replace the dataset in /home/$[YOUR_USERNAME]/garbage_dump/garbage_dump_detection/data
with yours and keep the data and folder format the same as ours.