Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions DeepDataMiningLearning/ngdet/detectors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,5 +186,10 @@ def build_detector(spec: str, taxonomy, device: str = "cuda",
# Expected: prints the registered detector backends (after importing adapters).
# ===========================================================================
if __name__ == "__main__":
from . import hf_detr, yolo, locate_anything # noqa: F401
print("Registered detector backends:", list(DETECTOR_REGISTRY))
# Under `python -m` this file runs as `__main__`; importing an adapter
# loads it a *second* time under its real name, and @register fills that
# copy's registry rather than this one. Read the canonical module so the
# self-test reports what a normal import sees instead of an empty list.
from DeepDataMiningLearning.ngdet.detectors import base as _canonical
from DeepDataMiningLearning.ngdet.detectors import hf_detr, yolo, locate_anything # noqa: F401
print("Registered detector backends:", list(_canonical.DETECTOR_REGISTRY))
9 changes: 7 additions & 2 deletions DeepDataMiningLearning/ngperception/depth/estimators/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,10 @@ def build_estimator(spec: str, device: str = "cuda", **kwargs) -> BaseDepthEstim
# Expected: prints the registered depth backends (after importing adapters).
# ===========================================================================
if __name__ == "__main__":
from . import hf_depth # noqa: F401
print("Registered depth backends:", list(DEPTH_REGISTRY))
# Under `python -m` this file runs as `__main__`; importing an adapter
# loads it a *second* time under its real name, and @register fills that
# copy's registry rather than this one. Read the canonical module so the
# self-test reports what a normal import sees instead of an empty list.
from DeepDataMiningLearning.ngperception.depth.estimators import base as _canonical
from DeepDataMiningLearning.ngperception.depth.estimators import hf_depth # noqa: F401
print("Registered depth backends:", list(_canonical.DEPTH_REGISTRY))