New models, woman and man face detection: Basically sponsored by @girlsthatdontexist, I actually don't know if they want to be mentioned, they can comment to claim that they did if so. So far anonymous and very charitable member of community. I was really lazy about posting those, but they persisted that i should, so thank them for those 2 new models:
Man face detection - tries to detect only real male faces in image.
Woman face detection - tries to detect only real female faces in image.
It was trained only on realistic images, so is unusable for anime. Can't promise i'll expand it in future, but possibility is there.
They, and all models going forward will be trained on Ultralytics >= 8.3, please update package in your webui of choice to use it, since most likely you are using 8.1 or 8.2, which will not work.
If you are having issues:
Activate your venv
pip install dillpip install --upgrade ultralytics
This should fix generic problems.
Small segmentation model aiming to create accurate masks of face for improved inpainting quality with adetailer extension.
V2: Tried to improve colored skin detection. Possibly improved detection from side.
Removed female/male separation, since i forgor which class was what, it's simpler that way.
This time around im releasing a small lineup of models, in order of quality you'll get in a1111: v2 640, v2 768 MS, v2 768, v2 1024
Use v2 640, if you need it for adetailer. Rest are situational and for out of automatic purposes, since adetailer extension doesn't support other than 640 resolution right now, it will use it with any of model listed above.
Can also be downloaded at HF: https://huggingface.co/Anzhc/Anzhcs_YOLOs
Script im using: https://github.com/Anzhc/Training-script-for-Ultralytics-YOLO
Usage
Put into `automatic1111/models/adetailer`, or any other place that you know will ork with YOLOv8 models.
Use.
What it does?
Instead of just finding face, it tries to create a mask covering face, which narrows down area of inpainting, which leads to better results, due to attention of model not spreading to anything else.
Yolo face mask:

My face mask:

Due to it being very small(in dataset), and experimental in nature, it's not generalized enough, and will have issues, so be advised.
P.S. In case of tolo face, WHOLE box is inpainted, while my model creates mask to inpaint.
In some cases, particularly close-ups and face shots, standard yolo face model will create hard burn


Because area of inpaint is almost whole image. In case of my model it tries to localize area, which doesn't create such burn.

But yes, here you can see that it's not quite adept with close-ups, and chops it quite a bit.
This is really easy to improve, but im busy with work and other stuff to really do that.
Description
It's just a prototype
FAQ
Comments (20)
In hugging face
This model has one file that has been marked as unsafe.
View unsafe files
Anzhc Face -seg.pt
This works pretty well, honestly - I've been impressed. One issue I've been having with it though, is it'll detect male AND female faces with overlapping bounding boxes - and then process them on top of each other. This doesn't seem to happen with the base YOLO models. Would you be able to separate out the models - so one for female faces, and one for male faces?
your ADtailer model is better than face_yolov8n.
However, what caught my attention was the inpaint when the eyebrows are drawn on top of the bangs in the illustration.
Your model cannot detect the eyebrows above the bangs, so
After inpainting, the eyebrows will be disconnected.
Is it possible to deal with this by setting parameters, etc.?
Thanks, this solved a huge problem I had with the yolov8 models whenever denoise strength was too high!
Working in Comfy, with slightly anime-proportioned faces, this works much better than the popular alternatives (yolo, mediapipe, grounding dino.) Reliable enough for batch work for me when those aren't. Hope that you make more segmenters (any kind!), but hopefully you can do it without the dill dependency issues-- still can't get your hair segmenter to run in Comfy.
much much better at anime face detection than the standard set. great job.
Hi, I currently have problem with dill. It keeps not finding the module and then the file becomes corrupted. I did the dill and ultralytics install for both my pc and the venv. Do you know how I would be able to fix this?
Hey, love the model, it works really well. I am currently trying to train my own segmentation model, even after trying your script I get the error:
AttributeError: 'Segment' object has no attribute 'detect'When I try to use it in A1111
What could cause this?
It says No module named 'dill' when I did the pip and update thing it says requirement already satisfied assuming that means that its already there so idk why im getting this error and idk what im supposed to do
Dude, this is what I've been looking for! I spent a few days testing it under various settings. The masks I've been getting for my images is great. It's a huge improvement over the square mask typically used by adetailer. There are some odd interactions, but it's not the masks this is created. It's the limitations of applying the mask in adetailer. I'll keep playing with adetailer to see if i can improve things. Mainly, I wanted to say this code is fantastic.
This is awesome!! Please make more! We need them segmented eye, segmented mouth, segmented nipples, segmented female genitalia, segmented teeth. All of those need whatever magic you put into this masterpiece.
its so f***** accurate !
P E R F E C T
so I'm getting a No module named 'dill' error in comfyui using the impact pack when using this Adetailer model. I've tired updated python and the dill library but still nothing see if you knew of this issue or could point me in the right direction to get this fixed.
Very nice ty so much. Can be used with SwarmUI to auto improve faces
is there any way to make it work in ComfyUI?
Works great, extremely useful. Great thanks to the dev + commissioner!
This is everything I wanted, I searched for it in the past, and now it's here, and it's perfect
do you know how to prevent/stop adetailer from turning the face orange? its like the region capture area refuses to leave for the final image. (im on ReForge)
Thanks! It works great in ComfyUI, the "No Dill" required option is really useful too.
Looks like we don't have an active mirror for this file right now.
CivArchive is a community-maintained index — we catalog mirrors that volunteers upload to HuggingFace, torrents, and other public hosts. Looks like no one has uploaded a copy of this file yet.
Some files do get recovered over time through contributions. If you're looking for this one, feel free to ask in Discord, or help preserve it if you have a copy.