Anzhcs YOLOs
简介
核心亮点
- 实时物体检测,推理速度快,延迟低
- 适配多种视觉场景,支持快速部署
- 基于 YOLO 架构,开发者上手难度低
- 采用 AGPL-3.0 协议,适合开源项目集成
使用方法
# 安装 Hugging Face transformers
pip install transformers torch
# 使用 transformers 加载模型
from transformers import AutoModel, AutoTokenizer
model = AutoModel.from_pretrained("Anzhc/Anzhcs_YOLOs")
tokenizer = AutoTokenizer.from_pretrained("Anzhc/Anzhcs_YOLOs")
Hugging Face 下载
我们推荐使用命令行或者 Hugging Face Hub SDK 来进行模型的下载。
操作指引:在下载前,请先通过如下命令安装 huggingface_hub:
pip install -U huggingface_hub
命令行下载
下载完整模型库
huggingface-cli download Anzhc/Anzhcs_YOLOs
下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)
huggingface-cli download Anzhc/Anzhcs_YOLOs config.json --local-dir ./dir
SDK 下载
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('Anzhc/Anzhcs_YOLOs')
Git 下载
请确保 lfs 已经被正确安装
git lfs install
git clone https://huggingface.co/Anzhc/Anzhcs_YOLOs
如果您希望跳过 lfs 大文件下载,可以使用如下命令
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/Anzhc/Anzhcs_YOLOs
模型文件托管在 Hugging Face Hub,使用 HF CLI / SDK / Git 直接下载,不经过本站。
PyTorch / Transformers 使用
安装 Transformers
pip install -U transformers torch
模型加载和推理
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained('Anzhc/Anzhcs_YOLOs')
tokenizer = AutoTokenizer.from_pretrained('Anzhc/Anzhcs_YOLOs')
模型下载
我们推荐使用命令行或者 ModelScope SDK 来进行模型的下载。
操作指引:在下载前,请先通过如下命令安装 ModelScope:
pip install modelscope
命令行下载
下载完整模型库
modelscope download --model Anzhc/Anzhcs_YOLOs
下载单个文件到指定本地文件夹(以下载 README.md 到当前路径下 dir 目录为例)
modelscope download --model Anzhc/Anzhcs_YOLOs README.md --local_dir ./dir
SDK 下载
# 模型下载
from modelscope import snapshot_download
model_dir = snapshot_download('Anzhc/Anzhcs_YOLOs')
Git 下载
请确保 lfs 已经被正确安装
git lfs install
git clone https://www.modelscope.cn/Anzhc/Anzhcs_YOLOs.git
如果您希望跳过 lfs 大文件下载,可以使用如下命令
GIT_LFS_SKIP_SMUDGE=1 git clone https://www.modelscope.cn/Anzhc/Anzhcs_YOLOs.git
ModelScope 模型页直接下载模型文件;无需将模型文件放在本站服务器。
Notebook 快速开发
下载并安装 ModelScope library
pip install "modelscope[audio,cv,nlp,multi-modal,science]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
模型加载和推理
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
p = pipeline('text-generation', 'Anzhc/Anzhcs_YOLOs')
完整文档
---
license: agpl-3.0
tags:
- pytorch
- YOLOv8
- art
- Ultralytics
base_model:
- Ultralytics/YOLO11
- Ultralytics/YOLOv8
library_name: ultralytics
pipeline_tag: object-detection
metrics:
- mAP50
- mAP50-95
---
Description
YOLOs in this repo are trained with datasets that i have annotated myself, or with the help of my friends(They will be appropriately mentioned in those cases). YOLOs on open datasets will have their own pages.
Known Adetailer Issues
~~Ultralytics 8.3.217 updates mask handling, which breaks function in main Adetailer repo. Install Ultralytics==8.3.216 or lower. Alternatively - use forks that fix this.~~ - Fixed in main repo.My Adetailer fork
I've added some features to make Adetailer more usable and less manual - https://github.com/Anzhc/aadetailer-reforge#### Want to request a model?
Im open to commissions, hit me up in Discord - anzhc
> ## Table of Contents
> - Face segmentation
> - *Universal*
> - *Real Face, gendered*
> - Eyes segmentation
> - Head+Hair segmentation
> - Breasts
> - *Breasts Segmentation*
> - *Breast size detection/classification*
> - Drone detection
> - Anime Art Scoring
> - Support
P.S. All model names in tables have download links attached :3
Available Models
Face segmentation:
#### Universal:
Series of models aiming at detecting and segmenting face accurately. Trained on closed dataset i annotated myself.
| Model | Target | mAP 50 | mAP 50-95 |Classes |Dataset size|Training Resolution|
|----------------------------------------------------------------------------|-----------------------|--------------------------------|---------------------------|---------------|------------|-------------------|
| Anzhc Face -seg.pt | Face: illustration, real | LOST DATA | LOST DATA |2(male, female)|LOST DATA| 640|
| Anzhc Face seg 640 v2 y8n.pt | Face: illustration, real |0.464(box) 0.453(mask) | 0.309(box) 0.207(mask)|1(face) |~500| 640|
| Anzhc Face seg 768 v2 y8n.pt | Face: illustration, real | ^ | ^ |1(face) |~500| 768|
| Anzhc Face seg 768MS v2 y8n.pt | Face: illustration, real | ^ | ^ |1(face) |~500| 768|(Multi-scale)|
| Anzhc Face seg 1024 v2 y8n.pt | Face: illustration, real | ^ | ^|1(face) |~500| 1024|
| Anzhc Face seg 640 v3 y11n.pt | Face: illustration | 0.524(box) 0.516(mask) | 0.387(box) 0.297(mask)|1(face) |~660| 640|
| [Anzhc Face seg 640 v4 y11n.pt]() | Face: illustration, real | 0.835(box) 0.800(mask) | 0.537(box) 0.467(mask)|1(face) |~1030| 640|
UPDATE: v3 model has a bit different face target compared to v2, so stats of v2 models suffer compared to v3 in newer benchmark, especially in mask, while box is +- same.
Dataset for v3 and above is going to be targeting inclusion of eyebrows and full eyelashes, for better adetailer experience without large dillution parameter.
Also starting from v3, im moving to yolo11 models, as they seem to be direct upgrade over v8. v12 did not show significant improvement while requiring 50% more time to train, even with installed Flash Attention, so it's unlikely i will switch to it anytime soon.
UPDATE: V4 - Addition of high complexity data (over 100 instances per image), more simple realistic and AI-generated faces.
Benchmark was performed in 640px.
V2 was condensed to single model, as their differences are marginal.
Benchmark results were recomputed on new val based on V4 dataset(images previously in val remained in val, so no contamination for previous versions), stats updated accordingly.
#### Real Face, gendered:
Trained only on real photos for the most part, so will perform poorly with illustrations, but is gendered, and can be used for male/female detection stack.
| Model | Target | mAP 50 | mAP 50-95 |Classes |Dataset size|Training Resolution|
| --------------------------- | --------------------- | ----------------------------- | ------------------------- |---------------|------------|-------------------|
| Anzhcs ManFace v02 1024 y8n.pt | Face: real | 0.883(box),0.883(mask) | 0.778(box), 0.704(mask) |1(face) |~340 |1024|
| Anzhcs WomanFace v05 1024 y8n.pt | Face: real | 0.82(box),0.82(mask) | 0.713(box), 0.659(mask) |1(face) |~600 |1024|
Benchmark was performed in 640px.
!image/png
Eyes segmentation:
Was trained for the purpose of inpainting eyes with Adetailer extension, and specializes on detecting anime eyes, particularly - sclera area, without adding eyelashes and outer eye area to detection. Current benchmark is likely inaccurate (but it is all i have), due to data being re-scrambled multi times (dataset expansion for future versions).| Model | Target | mAP 50 | mAP 50-95 |Classes |Dataset size|Training Resolution|
| --------------------------- | --------------------- | ----------------------------- | ------------------------- |---------------|------------|-------------------|
| Anzhc Eyes -seg-hd.pt | Eyes: illustration | 0.925(box),0.868(mask) | 0.721(box), 0.511(mask) |1(eye) |~500(?) |1024|
Head+Hair segmentation:
An old model (one of my first). Detects head + hair. Can be useful in likeness inpaint pipelines that need to be automated.| Model | Target | mAP 50 | mAP 50-95 |Classes |Dataset size|Training Resolution|
| --------------------------- | --------------------- | ----------------------------- | ------------------------- |---------------|------------|-------------------|
| Anzhc HeadHair seg y8n.pt | Head: illustration, real | 0.775(box),0.777(mask) | 0.576(box), 0.552(mask) |1(head) |~3180 |640|
| [Anzhc HeadHair seg y8m.pt](https://huggingf