# sdeval
[](https://pypi.org/project/sdeval/)



[](https://github.com/deepghs/sdeval/actions?query=workflow%3A%22Code+Test%22)
[](https://github.com/deepghs/sdeval/actions?query=workflow%3A%22Package+Release%22)
[](https://codecov.io/gh/deepghs/sdeval)

[](https://github.com/deepghs/sdeval/stargazers)
[](https://github.com/deepghs/sdeval/network)

[](https://github.com/deepghs/sdeval/issues)
[](https://github.com/deepghs/sdeval/pulls)
[](https://github.com/deepghs/sdeval/graphs/contributors)
[](https://github.com/deepghs/sdeval/blob/master/LICENSE)
Evaluation for stable diffusion model training
## Installation
You can simply install it with `pip` command line from the official PyPI site.
```shell
pip install sdeval
```
If your operating environment includes a available GPU, you can use the following installation command to achieve higher
performance:
```shell
pip install sdeval[gpu]
```
For more information about installation, you can refer
to [Installation](https://deepghs.github.io/sdeval/main/tutorials/installation/index.html).
## Quick Start
### CCIP Metrics
```python
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
```python
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
```python
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']))
```
Raw data
{
"_id": null,
"home_page": "https://github.com/deepghs/sdeval",
"name": "sdeval",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "Utilities of images.",
"author": "narugo1992",
"author_email": "narugo992@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ca/fc/213d53da150bed6baf1328593973c4fdc0e60663c4aa9c4557b083aac853/sdeval-0.0.4.tar.gz",
"platform": null,
"description": "# sdeval\n\n[](https://pypi.org/project/sdeval/)\n\n\n\n\n[](https://github.com/deepghs/sdeval/actions?query=workflow%3A%22Code+Test%22)\n[](https://github.com/deepghs/sdeval/actions?query=workflow%3A%22Package+Release%22)\n[](https://codecov.io/gh/deepghs/sdeval)\n\n\n[](https://github.com/deepghs/sdeval/stargazers)\n[](https://github.com/deepghs/sdeval/network)\n\n[](https://github.com/deepghs/sdeval/issues)\n[](https://github.com/deepghs/sdeval/pulls)\n[](https://github.com/deepghs/sdeval/graphs/contributors)\n[](https://github.com/deepghs/sdeval/blob/master/LICENSE)\n\nEvaluation for stable diffusion model training\n\n## Installation\n\nYou can simply install it with `pip` command line from the official PyPI site.\n\n```shell\npip install sdeval\n```\n\nIf your operating environment includes a available GPU, you can use the following installation command to achieve higher\nperformance:\n\n```shell\npip install sdeval[gpu]\n```\n\nFor more information about installation, you can refer\nto [Installation](https://deepghs.github.io/sdeval/main/tutorials/installation/index.html).\n\n## Quick Start\n\n### CCIP Metrics\n\n```python\nfrom sdeval.fidelity import CCIPMetrics\n\nccip = CCIPMetrics(images='/path/of/character/dataset')\n\n# ccip score of one image\nprint(ccip.score('/path/of/one/image'))\n\n# ccip score of a directory of images\nprint(ccip.score('/directory/of/images'))\n\n```\n\n### Bikini Plus Metrics\n\n```python\nfrom sdeval.controllability import BikiniPlusMetrics\n\n# build bikini plus score metrics\nbp = BikiniPlusMetrics(\n tag_blacklist=[\n 'bangs', 'long_hair', 'blue_eyes', 'animal_ears', 'sleeveless',\n 'breasts', 'grey_hair', 'medium_breasts'\n ]\n)\n\n# bp score of one image\n# the image should contain a1111 webui's metadata of prompts\nprint(bp.score('/path/of/one/image'))\n\n# bp score of a directory of images\n# the images should contain a1111 webui's metadata of prompts\nprint(bp.score('/directory/of/images'))\n\n```\n\n### AI Corrupt Metrics\n\n```python\nfrom sdeval.corrupt import AICorruptMetrics\n\n# build metrics\nmetrics = AICorruptMetrics()\n\n# get ai corrupt score for one image file\nprint(metrics.score('/path/of/one/image'))\n\n# get ai corrupt score of a directory of image files\nprint(metrics.score('/directory/of/images'))\n\n# get ai corrupt score of list of images\nprint(metrics.score(['image1.png', 'image2.png']))\n\n```\n",
"bugtrack_url": null,
"license": "Apache License, Version 2.0",
"summary": "Evaluation for stable diffusion model training",
"version": "0.0.4",
"project_urls": {
"Homepage": "https://github.com/deepghs/sdeval"
},
"split_keywords": [
"utilities",
"of",
"images."
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bf1192814dac5f4601d05bf062f646fa3729d97d5ef73df54455ec947d007c56",
"md5": "7313dd2cf07f7aec974e65eccee519f7",
"sha256": "860eb5b0d79a99cfb7142c86922902bc944dece8486dcc692181434681f3bcf4"
},
"downloads": -1,
"filename": "sdeval-0.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7313dd2cf07f7aec974e65eccee519f7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 17730,
"upload_time": "2024-01-26T08:17:57",
"upload_time_iso_8601": "2024-01-26T08:17:57.180640Z",
"url": "https://files.pythonhosted.org/packages/bf/11/92814dac5f4601d05bf062f646fa3729d97d5ef73df54455ec947d007c56/sdeval-0.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cafc213d53da150bed6baf1328593973c4fdc0e60663c4aa9c4557b083aac853",
"md5": "f0aabc2d256ec7b0af1fb3016084ec02",
"sha256": "e241b4c16328e3d42aa5d0d4a97298c2a18196210e1f1c111101af80bbb29521"
},
"downloads": -1,
"filename": "sdeval-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "f0aabc2d256ec7b0af1fb3016084ec02",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 17332,
"upload_time": "2024-01-26T08:17:58",
"upload_time_iso_8601": "2024-01-26T08:17:58.967467Z",
"url": "https://files.pythonhosted.org/packages/ca/fc/213d53da150bed6baf1328593973c4fdc0e60663c4aa9c4557b083aac853/sdeval-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-26 08:17:58",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "deepghs",
"github_project": "sdeval",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "sdeval"
}