Skip to main content

Anime Character Segmentation with DINOv2

Project description

AnimeSeg

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.3.tar.gz (10.2 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.3-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: anime_seg-0.1.3.tar.gz
  • Upload date:
  • Size: 10.2 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.3.tar.gz
Algorithm Hash digest
SHA256 46e40665f91b16416508d222eb352c15d3f6f7292e8c17bbf5086555f6158e03
MD5 75115d84d4fe891d31b3cff2c8aa62c0
BLAKE2b-256 f9aca743aa2fb567482c617520f9b49674ba88a9819acbc21b2d3408fab03e61

See more details on using hashes here.

File details

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

File metadata

  • Download URL: anime_seg-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 282f8543d148c5d86b7893259273017d91bf3e295d47b1844b158eaf498f316c
MD5 dc618ed435e03bfaafc83b0e60b66904
BLAKE2b-256 65cc4297ec450ee180079ab8ca27c688f3034bbd802e625cb43891c6e6a41eae

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