Skip to main content

Anime Character Segmentation with DINOv2

Project description

AnimeSeg

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

Installation

pip install -e .

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.0.3.tar.gz (6.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.0.3-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: anime_seg-0.0.3.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for anime_seg-0.0.3.tar.gz
Algorithm Hash digest
SHA256 6677e9040f0d2267c8f0f2d4956e7ac4b3031d37dd8a240ec892cf08b34b3f37
MD5 be5952f74c43e5828d920c3000042c06
BLAKE2b-256 9dbacccd2e8e48ee93967e614016ac8564bb5d073ffcc2991b0b1df0d951d38d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: anime_seg-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for anime_seg-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e1abd8defa8549ee44683b4e21241ec7ade06d26605a5c6d471739a767858f44
MD5 23db077eb2e490b33839ece83c8de2a8
BLAKE2b-256 e84e4eed102e45d6e63f7d11f69f85cad0003be9c44ae8cb4f45000b2ae840f3

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