Metadata-Version: 2.4
Name: anime_seg
Version: 0.1.3
Summary: Anime Character Segmentation with DINOv2
Home-page: https://github.com/suzukimain/AnimeSeg
Author: suzukimain
Author-email: gt13579552@gmail.com
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: torch>=2.0.0
Requires-Dist: numpy
Requires-Dist: Pillow
Requires-Dist: transformers
Requires-Dist: huggingface_hub
Requires-Dist: safetensors
Requires-Dist: peft
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# AnimeSeg

    Visitor Badge

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

## sample image

    sample image

## Installation

```bash
pip install anime_seg
```

## Usage

```python
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

```python
# 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
