-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
88 additions
and
101 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,24 @@ | ||
from .flash_utils import get_callable_dict | ||
from typing import Callable, Dict, Mapping, Sequence, Union | ||
|
||
from .image_utils import cv2_imshow, get_image_from_url, read_image_to_tensor | ||
from .update_module_state import update_module_state_from_ultralytics | ||
from .hooks_utils import FeatureExtractor | ||
from .hooks import FeatureExtractor | ||
|
||
__all__ = [ | ||
'cv2_imshow', 'get_image_from_url', 'read_image_to_tensor', | ||
'update_module_state_from_ultralytics', 'FeatureExtractor', | ||
'get_callable_dict', | ||
] | ||
|
||
|
||
def get_callable_name(fn_or_class: Union[Callable, object]) -> str: | ||
return getattr(fn_or_class, "__name__", fn_or_class.__class__.__name__).lower() | ||
|
||
|
||
def get_callable_dict(fn: Union[Callable, Mapping, Sequence]) -> Union[Dict, Mapping]: | ||
if isinstance(fn, Mapping): | ||
return fn | ||
elif isinstance(fn, Sequence): | ||
return {get_callable_name(f): f for f in fn} | ||
elif callable(fn): | ||
return {get_callable_name(fn): fn} |
This file was deleted.
Oops, something went wrong.
File renamed without changes.