huggingface / controlnet_aux

Apache License 2.0
400 stars 86 forks source link

UserWarning: Mapping deprecated model name.... #64

Open campbell-ja opened 1 year ago

campbell-ja commented 1 year ago

Hello,

following the usage page and info, I just want to run the midas depth preprocessor. when running I get this following error:

A matching Triton is not available, some optimizations will not be enabled.
Error caught was: No module named 'triton'

C:\Software\txt2img\ControlNet\venv\lib\site-packages\timm\models\_factory.py:114: UserWarning: Mapping deprecated model name vit_base_resnet50_384 to current vit_base_r50_s16_384.orig_in21k_ft_in1k.
  model = create_fn(

I understand the Triton error is there because I am running this via Windows and Triton is a linux only package. so it can be ignored as I understand it. I included it for the sake of repeatability. but for the warning:


C:\Software\txt2img\ControlNet\venv\lib\site-packages\timm\models\_factory.py:114: UserWarning: Mapping deprecated model name vit_base_resnet50_384 to current vit_base_r50_s16_384.orig_in21k_ft_in1k.
  model = create_fn(

is there anything I can do to remove the message? here is my current code:

from PIL import Image
import requests
from io import BytesIO
from controlnet_aux import MidasDetector

# load image
url = "https://huggingface.co/lllyasviel/sd-controlnet-depth/resolve/main/images/stormtrooper.png"

response = requests.get(url)
img = Image.open(BytesIO(response.content)).convert("RGB").resize((512, 512))

# load model

midas = MidasDetector.from_pretrained("lllyasviel/Annotators")

# instantiate
# ...is this required? 

# process
processed_image_midas = midas(img)

# save
processed_image_midas.save('processed_image_midas.png')

the above code still outputs the expected midas image results. I was just hoping to ensure I had everything correct.

thank you for your time!

patrickvonplaten commented 1 year ago

Ah yeah that's a deprecation warning, I think ideally we should open a PR to this repo here to use the updated checkpoint name