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.4.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.4-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: anime_seg-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 fc7b22d7338a4c62053b3b8561b509440b47ebccf60f1508cdc494d01747cab7
MD5 2806757b8cd094418d1e563fb09f1754
BLAKE2b-256 9c60f9921917772a8d47508c70eb7e8a5df0eca65f36ed209e4e7ec739aac580

See more details on using hashes here.

File details

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

File metadata

  • Download URL: anime_seg-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 aded73055e67601aaf61781787cdcae9c95151618fe99bd0db1b787b12315835
MD5 d8b39a37cba5c324bf9cb6c66f3f7864
BLAKE2b-256 cdccf563bf540b9b0b4145f74f59653d2319a50c8c5403b6299de7d9a21dc1a3

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