Publishing and using a program that automatically collects facial images of specified people

PS (17/10/04)

Since the maximum number of sheets that can be collected at one time was 60 according to the specifications of the scraping source, up to 120 sheets were supported.

PS (17/10/11)

I didn't have a cascade classification file, so I added it.

PS (18/04/14)

The number of cards that can be collected at one time has been increased from 120 to unlimited. The code in that part is dirty with in locals ()

Introduction

I think it's quite possible to do machine learning with the theme of a person's face, but it's a hassle to pick up and process each one, so I made something that does everything automatically. I felt that someone had already made it, but there was nothing that could be used as it was, so I will publish it here.

Download (github)

How to use

If you do not have the following two, please enter them. Excuse me… ・ OpenCV3 series ・ Beautiful Soup 4 series

Make sure that the terminal you are running is connected to the internet to collect from the internet.

Run FaceImageCollector> image_gather> gather.py. You will be asked in the order of keyword, number of sheets, and edit mode.

スクリーンショット 2017-09-08 20.38.36.png

In the image, I set 30 images of Zuckerberg and trimmed the face. The download will start.

スクリーンショット 2017-09-08 20.40.04.png

When the specified number of sheets is completed, an img folder will be created in image_gather and a folder with the keyword specified this time will be created there.

スクリーンショット 2017-09-08 20.25.34.png

Details of improvement

-Allow automatic trimming even when an object other than a person is entered as a keyword. -Because contour drawing is not implemented, implement it. (A rectangle is drawn on the face detected as a first aid measure)

If you have any other ideas that would be useful if you could do it automatically, please let me know!

in conclusion

It's not a long code, but I'll explain it when I have time. Thank you for visiting us so far!

Recommended Posts

Publishing and using a program that automatically collects facial images of specified people
A Python script that automatically collects typical images using bing image search
Nogizaka46 A program that automatically saves blog images
Automatically generate images of koalas and bears
A program that plays rock-paper-scissors using Python
I made a program in Python that reads CSV data of FX and creates a large amount of chart images
Create a program that automatically inputs and sends body temperature every morning [Note]
I want to exe and distribute a program that resizes images Python3 + pyinstaller
[Python] A program that finds the minimum and maximum values without using methods
[Python] A program that calculates the number of updates of the highest and lowest records
A program that sends a fixed amount of mail at a specified time by Python
[Python] A program that counts the number of valleys
Create a batch of images and inflate with ImageDataGenerator
A shell program that becomes aho in multiples of 3
Collection and automation of erotic images using deep learning
[Python] A program that compares the positions of kangaroos.
[Python] A program to find the number of apples and oranges that can be harvested
A Python program that collects tweets containing specific keywords daily and saves them in csv
A tool that automatically turns the gacha of a social game
[Python] Chapter 01-03 About Python (Write and execute a program using PyCharm)
A program that just presses and releases the Esc key
A program that receives the servo command of the radio control, interrupts the Raspberry Pi and logs it
[Python] A program that compares each element of list one by one and wins or loses. zip ()