Skip to content

GaengSu/TrashDetector

Repository files navigation

TrashDetector

  • automatic trash separator using yolo

Development Intention

  • Before explaining, this is my Capstone Design Results.
  • Garbage is being dumped indiscriminately(thoughtless) on the campus.
  • If it is thrown away without recycling, it will take a lot of time and manpower to classify it, so recycling is not possible now.
  • So we developed the Trash Detector that encourages students to throw garbage into trash cans.

Hardware

  • Raspberry 3b+
  • Motor Driver - pca9685
  • Servo moter - mg996r
  • Unused smartphone - samsung galaxy s7

Connection Diagram

1589167164935

Inner Hardware Configuration

Servo moter and moter driver 20200508_195537 20200508_205410

Test Operation Videos

Four directions

Four directions

Seperating garbage collection Without detection

Four directions

Trash Detection ex

KakaoTalk_20200904_153048172_04

Face video & making images for train dataset

Four directions

그림1 그림2

Face detection

Four directions

Final result - Detecting disposable paper cup

KakaoTalk_20200905_013534134_01

Final result - Detecting can

KakaoTalk_20200905_013534134_02

The end of trash seperation

KakaoTalk_20200905_014102423_03 KakaoTalk_20200905_014102423_01 KakaoTalk_20200905_014102423_02

Presentation Video (korean)

Four directions

Environments

  • Raspbian OS
  • python 3.6
  • Opencv
  • MTCNN

How to use

Face Detection

  • First, We receive a full face video from the user, which is about 10 to 20 seconds.
  • Second, in per_frame_video.py, we can split the video into a frame and save it as an image. This becomes train dataset.
  • Third, in boxing.py, The mtcnn module produces an xml file whith store facial coordinates and multiple information in all images.
  • The xml file is not appropriate because we are going to use yolo. Therefore, convert all xml files into txt files, i.e. yolo format. (in xml_to_yolo.py)
  • And then, we already construct train dataset(face dataset), train it!

Trash Detection (NOT USAGE, WHAT I DO)

  • We collected 4,000 images from the kagle, 2,000 images from the local dataset taken by ourselves, and 2,000 images from the coil dataset to form the garbage dataset.
  • So, I labelled all 8,000 images myself.
  • And, train it!

Files

  • detection_dnn.py is detect the object and counts what kind of the trash is and returns the nearest classification(ex. plastic, paper, can.. etc).
  • detection_face.py is detect the face, counts whose face it is close to, and returns the person who counts the most.
  • ctr_final.py is the main file of this project. in this file, it detect the face and checks who throws it away, checks which garbage is, gives the user a reward, runs motor control, and collects it separately.

Notice

  • In my repository there is no weights files, because they are heavy files. If you want our trained weights, contect me.
  • Because I was in charge of object detection, I am not well aware of the applications and servers, databases, and motor control used.

Contect