From c20c45e636b727b7ec1b73609792f80c57b29aa0 Mon Sep 17 00:00:00 2001 From: zilliz Date: Tue, 26 Jul 2022 16:26:17 +0800 Subject: [PATCH] fix detectron2 install issue --- __init__.py | 7 ------- detectron.py | 7 ++++++- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/__init__.py b/__init__.py index f459787..a635800 100644 --- a/__init__.py +++ b/__init__.py @@ -1,10 +1,3 @@ -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 diff --git a/detectron.py b/detectron.py index c3539ce..5e36607 100644 --- a/detectron.py +++ b/detectron.py @@ -1,5 +1,10 @@ from typing import List, Tuple - +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 detectron2 import model_zoo from detectron2.config import get_cfg from detectron2.engine.defaults import DefaultPredictor