Metadata-Version: 2.1
Name: waifutagger
Version: 0.1.0
Summary: A simple tagger for anime-style images using WaifuDiffusion models
Author-email: Your Name <your.email@example.com>
Project-URL: Homepage, https://github.com/yourusername/waifutagger
Project-URL: Repository, https://github.com/yourusername/waifutagger.git
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.19.0
Requires-Dist: onnxruntime>=1.7.0
Requires-Dist: Pillow>=8.0.0
Requires-Dist: huggingface_hub>=0.7.0
Requires-Dist: pandas>=1.2.0

# WaifuTagger

A Python package for tagging anime-style images using WaifuDiffusion models. This package provides a simple interface to detect and tag various elements in anime/manga-style illustrations.

## Features

- Support for multiple WaifuDiffusion models
- Simple and batch image processing
- Flexible tag output formats
- Automatic threshold adjustment (MCut)
- Progress tracking for batch operations

## Installation

```
pip install waifutagger
```

## Quick Start

```
from waifutagger import WaifuTagger

# Initialize tagger
tagger = WaifuTagger("eva02-large-v3")  # or any other available model

# Process single image
results = tagger.predict("image.jpg")

# Print tags
print(results['rating'])           # Image rating
print(results['general_tags'])     # General tags
print(results['character_tags'])   # Character tags

# Get formatted string
from waifutagger.formatters import format_tags
tags_string = format_tags(results)
print(tags_string)  # "rating_general, 1girl, solo, long_hair, ..."
```

## Available Models

- swinv2-v3: SmilingWolf/wd-swinv2-tagger-v3
- convnext-v3: SmilingWolf/wd-convnext-tagger-v3
- vit-v3: SmilingWolf/wd-vit-tagger-v3
- vit-large-v3: SmilingWolf/wd-vit-large-tagger-v3
- eva02-large-v3: SmilingWolf/wd-eva02-large-tagger-v3
- And more...

## Advanced Usage

### Batch Processing

```
# Process multiple images
image_paths = ["img1.jpg", "img2.jpg", "img3.jpg"]
for img_path in image_paths:
    results = tagger.predict(img_path)
    # Save results
    with open(f"{img_path}_tags.txt", "w") as f:
        f.write(format_tags(results))
```

### Custom Thresholds

```
# Use custom thresholds
results = tagger.predict(
    "image.jpg",
    general_threshold=0.4,    # Higher threshold for general tags
    character_threshold=0.9   # Higher threshold for character tags
)
```

### MCut Thresholding

```
# Use automatic threshold adjustment
results = tagger.predict(
    "image.jpg",
    general_use_mcut=True,    # Use MCut for general tags
    character_use_mcut=True   # Use MCut for character tags
)
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

This project is licensed under the MIT License - see the LICENSE file for details.

## Acknowledgments

This package is based on the WaifuDiffusion tagger models by [SmilingWolf](https://huggingface.co/SmilingWolf).
