Skip to content

Commit

Permalink
Add download_utils to __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
pooya-mohammadi committed May 27, 2023
1 parent ea80b93 commit e0d437f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion deep_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
is_monai_available,
is_timm_available,
is_glide_text2im_available,
is_pillow_available
is_pillow_available,
is_requests_available,
)

# Deep Utils version number
Expand All @@ -37,6 +38,16 @@
"utils.logging_utils.logging_utils": ["get_logger"],

}

if is_requests_available():
_import_structure["utils.download_utils.download_utils"] = ["DownloadUtils"]
else:
from ._dummy_objects import requests_dummy

_import_structure["_dummy_objects.requests_dummy"] = [
name for name in dir(requests_dummy) if not name.startswith("_")
]

if is_groundingdino_available() and is_torch_available() and is_pillow_available():
_import_structure["vision.text2box_visual_grounding.dino.visual_grounding_dino_torch"] = [
"Text2BoxVisualGroundingDino"]
Expand Down Expand Up @@ -160,6 +171,7 @@
from .utils.logging_utils.logging_utils import get_logger
# from .vision.image_editing.glide.glide_image_editing import ImageEditingGLIDE
from .vision.text2box_visual_grounding.dino.visual_grounding_dino_torch import Text2BoxVisualGroundingDino
from .utils.download_utils.download_utils import DownloadUtils
else:
import sys

Expand Down

0 comments on commit e0d437f

Please sign in to comment.