huggingface / controlnet_aux

Apache License 2.0
381 stars 83 forks source link

mediapipe warning #82

Open rb-synth opened 11 months ago

rb-synth commented 11 months ago

When the Processor class is imported, all possible processors are also imported. This results in this warning being displayed, even though I have no intention of using the processor that requires mediapipe. Would it be possible to move this warning into runtime? Such that the warning is only displayed if one tried to use the relevant processor?

rb-synth commented 11 months ago

The same is true of:

  /home/user/mambaforge/envs/env/lib/python3.10/site-packages/controlnet_aux/open_pose/hand.py:4: DeprecationWarning: Please use `gaussian_filter` from the `scipy.ndimage` namespace, the `scipy.ndimage.filters` namespace is deprecated.

which comes from open_pose, and

  /home/user/mambaforge/envs/env/lib/python3.10/site-packages/timm/models/registry.py:4: DeprecationWarning: Importing from timm.models.registry is deprecated, please import via timm.models
    warnings.warn(f"Importing from {__name__} is deprecated, please import via timm.models", DeprecationWarning)

which comes from segment anything.

patrickvonplaten commented 10 months ago

I would maybe not import the processor in this case and just directly import the specific processor class you need

rb-synth commented 9 months ago

When I import the specific processor (e.g., from controlnet_aux.open_pose import OpenposeDetector), I still get this output:

/home/richardbrown/mambaforge/envs/inpaint_dreambooth/lib/python3.10/site-packages/controlnet_aux/mediapipe_face/mediapipe_face_common.py:7: UserWarning: The module 'mediapipe' is not installed. The package will have limited functionality. Please install it using the command: pip install 'mediapipe'
  warnings.warn(
/home/richardbrown/mambaforge/envs/inpaint_dreambooth/lib/python3.10/site-packages/controlnet_aux/segment_anything/modeling/tiny_vit_sam.py:654: UserWarning: Overwriting tiny_vit_5m_224 in registry with controlnet_aux.segment_anything.modeling.tiny_vit_sam.tiny_vit_5m_224. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
  return register_model(fn_wrapper)
/home/richardbrown/mambaforge/envs/inpaint_dreambooth/lib/python3.10/site-packages/controlnet_aux/segment_anything/modeling/tiny_vit_sam.py:654: UserWarning: Overwriting tiny_vit_11m_224 in registry with controlnet_aux.segment_anything.modeling.tiny_vit_sam.tiny_vit_11m_224. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
  return register_model(fn_wrapper)
/home/richardbrown/mambaforge/envs/inpaint_dreambooth/lib/python3.10/site-packages/controlnet_aux/segment_anything/modeling/tiny_vit_sam.py:654: UserWarning: Overwriting tiny_vit_21m_224 in registry with controlnet_aux.segment_anything.modeling.tiny_vit_sam.tiny_vit_21m_224. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
  return register_model(fn_wrapper)
/home/richardbrown/mambaforge/envs/inpaint_dreambooth/lib/python3.10/site-packages/controlnet_aux/segment_anything/modeling/tiny_vit_sam.py:654: UserWarning: Overwriting tiny_vit_21m_384 in registry with controlnet_aux.segment_anything.modeling.tiny_vit_sam.tiny_vit_21m_384. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
  return register_model(fn_wrapper)
/home/richardbrown/mambaforge/envs/inpaint_dreambooth/lib/python3.10/site-packages/controlnet_aux/segment_anything/modeling/tiny_vit_sam.py:654: UserWarning: Overwriting tiny_vit_21m_512 in registry with controlnet_aux.segment_anything.modeling.tiny_vit_sam.tiny_vit_21m_512. This is because the name being registered conflicts with an existing name. Please check if this is not expected.
  return register_model(fn_wrapper)

I think this is because everything is imported in the base level __init__.py.