import os try: import detectron2 except ModuleNotFoundError: os.system("git clone https://github.com/facebookresearch/detectron2.git") os.system("python -m pip install -e detectron2") from .detectron import Detectron2 def detectron2(*args, **kwargs): return Detectron2(*args, **kwargs)