controlnet-aux-0.0.3
توضیحات
Human Pose
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | controlnet-aux-0.0.3 |
| نام | controlnet-aux |
| نسخه کتابخانه | 0.0.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | The HuggingFace team |
| ایمیل نویسنده | patrick@huggingface.co |
| آدرس صفحه اصلی | https://github.com/patrickvonplaten/controlnet_aux |
| آدرس اینترنتی | https://pypi.org/project/controlnet-aux/ |
| مجوز | Apache |
# ControlNet auxiliary models
This is a PyPi installable package of [lllyasviel's ControlNet Annotators](https://github.com/lllyasviel/ControlNet/tree/main/annotator)
The code is copy-pasted from the respective folders in https://github.com/lllyasviel/ControlNet/tree/main/annotator and connected to [the 🤗 Hub](https://huggingface.co/lllyasviel/Annotators).
All credit & copyright goes to https://github.com/lllyasviel .
## Install
```
pip install controlnet-aux==0.0.3
```
## Usage
```python
from PIL import Image
import requests
from io import BytesIO
from controlnet_aux import HEDdetector, MidasDetector, MLSDdetector, OpenposeDetector, PidiNetDetector, NormalBaeDetector, LineartDetector, LineartAnimeDetector, CannyDetector, ContentShuffleDetector
# load image
url = "https://huggingface.co/lllyasviel/sd-controlnet-openpose/resolve/main/images/pose.png"
response = requests.get(url)
img = Image.open(BytesIO(response.content)).convert("RGB").resize((512, 512))
# load checkpoints
hed = HEDdetector.from_pretrained("lllyasviel/Annotators")
midas = MidasDetector.from_pretrained("lllyasviel/Annotators")
mlsd = MLSDdetector.from_pretrained("lllyasviel/Annotators")
open_pose = OpenposeDetector.from_pretrained("lllyasviel/Annotators")
pidi = PidiNetDetector.from_pretrained("lllyasviel/Annotators")
normal_bae = NormalBaeDetector.from_pretrained("lllyasviel/Annotators")
lineart = LineartDetector.from_pretrained("lllyasviel/Annotators")
lineart_anime = LineartAnimeDetector.from_pretrained("lllyasviel/Annotators")
# instantiate
canny = CannyDetector()
content = ContentShuffleDetector()
# process
processed_image_hed = hed(img)
processed_image_midas = midas(img)
processed_image_mlsd = mlsd(img)
processed_image_open_pose = open_pose(img, hand_and_face=True)
processed_image_pidi = pidi(img, safe=True)
processed_image_normal_bae = normal_bae(img)
processed_image_lineart = lineart(img, coarse=True)
processed_image_lineart_anime = lineart_anime(img)
processed_image_canny = canny(img)
processed_image_content = content(img)
```
نیازمندی
| مقدار | نام |
|---|---|
| - | Pillow |
| - | einops |
| - | filelock |
| - | huggingface-hub |
| - | importlib-metadata |
| - | numpy |
| - | opencv-python |
| - | scikit-image |
| - | scipy |
| - | timm |
| - | torch |
| - | torchvision |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7.0 | Python |
نحوه نصب
نصب پکیج whl controlnet-aux-0.0.3:
pip install controlnet-aux-0.0.3.whl
نصب پکیج tar.gz controlnet-aux-0.0.3:
pip install controlnet-aux-0.0.3.tar.gz