Disposing of garbage is a bad thing that can spoil the view, cause bad smells, cause low to high level flooding, cause various diseases and can pollute the environment. Even though the ban on disposing of trash has been implemented, there are still many who violate it. The importance of avoiding this makes a study aimed at automatically detecting violations of waste disposal. The method used is YOLOv5, this method is an algorithm that can identify objects with high accuracy, besides that it can also carry out tracking processes in the form of bounding boxes for objects in real time. The programming language used is Google Colaboratory. The dataset used is in the form of 800 images and 2 videos. After testing the results of the research using the You only look once (YOLO) method, the best results were obtained on the parameter batch 5 epochs 5 with an accuracy of 95%. From these results it can be concluded that the use of the YOLO method is very accurate when applied to the detection process of an object.