Skip to main content

Evaluation for stable diffusion model training

Project description

sdeval

PyPI PyPI - Python Version Loc Comments

Code Test Package Release codecov

GitHub Org's stars GitHub stars GitHub forks GitHub commit activity GitHub issues GitHub pulls Contributors GitHub license

Evaluation for stable diffusion model training

Installation

You can simply install it with pip command line from the official PyPI site.

pip install sdeval

If your operating environment includes a available GPU, you can use the following installation command to achieve higher performance:

pip install sdeval[gpu]

For more information about installation, you can refer to Installation.

Quick Start

CCIP Metrics

from sdeval.fidelity import CCIPMetrics

ccip = CCIPMetrics(images='/path/of/character/dataset')

# ccip score of one image
print(ccip.score('/path/of/one/image'))

# ccip score of a directory of images
print(ccip.score('/directory/of/images'))

Bikini Plus Metrics

from sdeval.controllability import BikiniPlusMetrics

# build bikini plus score metrics
bp = BikiniPlusMetrics(
    tag_blacklist=[
        'bangs', 'long_hair', 'blue_eyes', 'animal_ears', 'sleeveless',
        'breasts', 'grey_hair', 'medium_breasts'
    ]
)

# bp score of one image
# the image should contain a1111 webui's metadata of prompts
print(bp.score('/path/of/one/image'))

# bp score of a directory of images
# the images should contain a1111 webui's metadata of prompts
print(bp.score('/directory/of/images'))

AI Corrupt Metrics

from sdeval.corrupt import AICorruptMetrics

# build metrics
metrics = AICorruptMetrics()

# get ai corrupt score for one image file
print(metrics.score('/path/of/one/image'))

# get ai corrupt score of a directory of image files
print(metrics.score('/directory/of/images'))

# get ai corrupt score of list of images
print(metrics.score(['image1.png', 'image2.png']))

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

sdeval-0.0.3.tar.gz (17.0 kB view hashes)

Uploaded Source

Built Distribution

sdeval-0.0.3-py3-none-any.whl (17.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page