HeardLibrary / vandycite

0 stars 0 forks source link

Test OpenCV face detection machine-learning #11

Open baskaufs opened 2 years ago

baskaufs commented 2 years ago

Tasks for 2021-10-19 meeting:

  1. Download the improved Jupyter notebook.
  2. Run the script on all of the test images in the Box folder.
  3. Put the resulting files (ending in "_faces.png" and "_data.json" in the Box folders where the original images came from.

We can plan to meet in person since I will be on campus that day.

baskaufs commented 2 years ago

When you run it, you must run these cells:

There are two main improvements:

  1. I figured out how to change the classifier training function. In the cell after "Testing the function on new image", there are four choices for "haar_cascade_face" that you can change by uncommenting. The one we were using (haarcascade_frontalface_alt2.xml) is strict and misses a lot of faces. The haarcascade_frontalface_default.xml one is less strict and finds faces in a lot more images, but it also generates false negatives as you will see when you try it out. You can test the different ones with different images, but I think we should probably use this one.
  2. The last cell automatically saves the marked-up file in the same folder as the original and with the same filename but with "_faces.png" appended to the name. It also saves a JSON file with the coordinates of the bounding boxes of the faces it finds. We should have those data for future use.