Skip to main content

Anime Character Segmentation with DINOv2

Project description

AnimeSeg

GitHub release GitHub release Visitor Badge

Anime Character Segmentation using DINOv2 + U-Net++ with LoRA fine-tuning.

sample image

sample image

Installation

pip install anime_seg

Usage

from anime_seg import AnimeSegPipeline

# Initialize pipeline (auto-downloads latest model from Hugging Face)
pipe = AnimeSegPipeline()

# Run segmentation
mask = pipe("path/to/image.jpg")

# Save result
mask.save("output.png")

Advanced Usage

# Specify custom repo or filename
pipe = AnimeSegPipeline(
    repo_id="suzukimain/AnimeSeg",
    filename="models/anime_seg_dinov2_large_v1.safetensors",
    device="cuda"  # or "cpu"
)

# Use PIL Image
from PIL import Image
img = Image.open("image.jpg")
mask = pipe(img)

Model Files

Models should follow the naming convention:

models/anime_seg_{architecture}_{size}_v{version}.safetensors

Example:

  • models/anime_seg_dinov2_large_v1.safetensors
  • models/anime_seg_dinov2_base_v2.safetensors

Segmentation Classes

  • Background
  • Skin
  • Face
  • Hair (main)
  • Hair (thin)
  • Eyes (left/right)
  • Eyebrows (left/right)
  • Nose
  • Mouth
  • Clothes
  • Unknown

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anime_seg-0.1.5.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anime_seg-0.1.5-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file anime_seg-0.1.5.tar.gz.

File metadata

  • Download URL: anime_seg-0.1.5.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for anime_seg-0.1.5.tar.gz
Algorithm Hash digest
SHA256 6a0d830b5f6d95a777d5526701a430b4da77065b6cc742e428ed01d4e7aa86e8
MD5 0ee7bda7813f755f4aad071b283a5140
BLAKE2b-256 e293924530870ba85dcb71bad2ee0ed41522699154b88c3514fff7f31dc9aa1d

See more details on using hashes here.

File details

Details for the file anime_seg-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: anime_seg-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for anime_seg-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c2ff3e7129a90bae3e5c12b1997666f3a93f3aaca754b8958822ce530735f00a
MD5 0ccb02c8ecea9348261261313ba16a37
BLAKE2b-256 78fef0db2b8f507a3b9578ea3e15a2c7320ff34a7ec5b621fab8b37ea684b21d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page