Project 3 part 1 "Mask / No mask", trained with Darknet and Yolov3.cfg
Video output from test-video1 with standard darknet rectangles:
Video output from test-video1.mp4:
Video output from test-video2 with standard darknet rectangles:
Video output from test-video1.mp4:
Task 1: Train the object detector using Yolo v3 [70 Marks]
We had shared a notebook for training a
custom object detector in the last section. You can use that as a reference and
make relevant changes to the files and code to train the network.
HINT: You will have to make a few changes to the
different files before training as given in Step 7 in the Notebook. You might
also need to change some code in Step 4.
You also need to run the model on the
videos given above.
HINT: You can use the following command to run the model on
the video
!./darknet detector demo yolo_mask.data yolo_mask.cfg
backup/yolo_mask_best.weights test-video1.mp4 -thresh .6 -out_filename
out-vid1.avi -dont_show
I wrote a notebook with the basic pipeline for train a yolov3 cnn with Darknet in Google colab, this are the steps:
1.- I
created a folder "/yolov3" in Google drive to upload the test and output files.
2.- Mount a
google drive and check its files.
3.- Clone,
configure and compile darknet.
10.- Object detection with the test images.
11.- Object detection with the test videos.
I wished to run all the yolov4 using "activation: mist" in one notebook at colab, I couldn’t do that because the OpenCV version in colab was 4.1.2, so I left this project aside for several days, when I went back I understood from the hint in the specifications that darknet is a polymorph program, it can do train and test on images, videos and camera stream, it draws the standard rectangles over the images and don’t need OpenCV to do that. I trained yolov3 and yolov4 again; here are some screenshots from the notebook. I changed the file image.c from darknet source files, so the rectangle on people with facemask is green and magenta(danger) with No mask.
The prediction for test-video2:
No hay comentarios:
Publicar un comentario