Gender Classifier - Low Colors & Multiple Face Remover - Stable Diffusion Training Images Preprocessor (Patreon)
Published:
2023-11-09 22:26:13
Imported:
Downloads
Content
Join discord and tell me your discord username to get a special rank : SECourses Discord
This script uses Retina Face and a fine tuned gender-classification model from Hugging Face. Both are state of the art very high accuracy.
12 November 2023 whole post updated. Huge improvements. Now supports Retina Face GPU
Requirements:
- Make sure that you have git and Python 3.10.x installed. I used Python 3.10.11.
- May work with other Pythons too but I haven't tested
- Here a tutorial video : https://youtu.be/B5U7LJOvH6g
How To Use:
- Download gender_classifier.zip into any folder where you want to install
- Extract it. This file contains all 7 attached files so same.
- First run install.bat file. You need to double click and run only 1 time.
- It will generate a new VENV and install all necessary libraries.
- This will not break or affect your other Python apps and installations.
- Edit classify_and_process.py and change below folder paths.
- source_folder = r'G:\gender_classifier\blur_test'
- no_face_folder = r'G:\man dataset\no_face_detected'
- multi_face_folder = r'G:\man dataset\multi_faces_detected'
- blurry_folder = r'G:\man dataset\blurry_faces_detected'
- low_color_folder = r'G:\man dataset\low_colored_images'
- male_folder = r'G:\man dataset\male_new_images'
- female_folder = r'G:\man dataset\female_new_images'
- unknown_folder = r'G:\man dataset\unknown_images'
- log_file_path = 'logs.txt'
- DEBUG_IMAGES = True
- ENABLE_BLURRY_DETECTION = False
- DEBUG_FOLDER = 'debug_folder_path'
sort_sharp
This script will sort images based on their sharpness / blurness. Can be used to sort
- Edit sort_sharp.py and set below paths
- images_folder_path = r"G:\gender_classifier\blur_test"
- log_file_path_sharpness = r"G:\gender_classifier\sharpness_logs.txt"
- log_file_path = r"G:\gender_classifier\processing_log.txt"
- sorting_image_prefix="man"
You can change prefix to like woman, img, etc.
Also it will start with 10000 but if you have over 90000 images start from 100000
Hopefully a tutorial video coming soon.