You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This algorithm can be mainly used for cleaning data. It helps in predicting the gender of a given image from the face in the image. If the face is not found, the image gets deleted. We can customize the algorithm according to our needs.
13
+
Data cleansing is the major use for this algorithm. It aids in determining the gender of an image by looking at the face. The image is erased if the face cannot be located. The algorithm can be altered to suit different requirements.
14
14
15
15
## General Script
16
16
@@ -46,17 +46,17 @@ print(f"Runtime of the program is {end-start}") # To print out the final executi
46
46
```
47
47
## Use Cases:-
48
48
49
-
## 1. To keep only the images that contain Human face and remove noisy images.
49
+
## 1. To eliminate noisy photos and only keep images with human faces.
The folder contains a combination of several images taken from the internet. The files are images of different genders and some corrupted ones. We can use our script to get rid of these noisy images.
52
+
Multiple photographs taken from the internet are combined in the folder. The files contain photos of various genders, some of which are corrupt. These noisy photos can be removed with the help of our script.
The noisy images shown here are not just random images. These are actually images which contain the features of a face in some way. These are the output of face cropped out from an MTCNN face detector model.
59
+
The noisy images displayed here are not just arbitrary snapshots. In reality, these are pictures that in some way depict the attributes of a face. These are the results of a face detector model using MTCNN that was cropped out.
60
60
61
61
### Implementation
62
62
@@ -70,16 +70,16 @@ After running the script we will obtain the following results as shown below.
Progress bar is shown for understanding the cleaning status.
78
78
Total execution time will be printed out at the end along with the text "All is done".
79
79
80
-
## 2. To count the no of images with human faces.
80
+
## 2. To determine how many photos contain human faces.
81
81
82
-
The same directory above is used here. To find out the count of images with human faces we need to add a variable count and make some necessary changes.
82
+
This uses the same directory as above. We must add a variable count and make the appropriate adjustments in order to determine the number of photos that contain human faces.
83
83
84
84
```python
85
85
from deepface import DeepFace
@@ -106,7 +106,7 @@ Output is given as
106
106
No of human faces =9
107
107
```
108
108
109
-
## 3. To keep only the images with face of Man.
109
+
## 3. To only save pictures with male faces.
110
110
111
111
### Implementation
112
112
@@ -116,11 +116,11 @@ if result['gender'] != "Man" #change the General script with this line of code.
116
116
os.remove(path)
117
117
```
118
118
119
-
After running the script we will obtain the folder consisting of only images of man and rest of them removed.
119
+
After executing the script, we will receive a folder with only photographs of men in it and the rest empty.
The easiest way to install the required libraries is to download it from [`PyPI`](https://pypi.org/). It's going to install the libraries itself and its prerequisites as well.
139
+
The essential libraries can be downloaded from ['PyPI'](https://pypi.org/) for installation. The libraries themselves as well as their requirements will be installed.
0 commit comments