From 2ea23239e06587977bdcada4615067bd057f9281 Mon Sep 17 00:00:00 2001 From: Kaipeng Deng Date: Thu, 26 Aug 2021 10:38:54 +0800 Subject: [PATCH] set highest import priority for current dir (#4020) --- tools/anchor_cluster.py | 3 +-- tools/eval.py | 3 +-- tools/eval_mot.py | 3 +-- tools/export_model.py | 3 +-- tools/infer.py | 3 +-- tools/infer_mot.py | 3 +-- tools/train.py | 3 +-- 7 files changed, 7 insertions(+), 14 deletions(-) diff --git a/tools/anchor_cluster.py b/tools/anchor_cluster.py index 78ed3ea07..688c37fad 100644 --- a/tools/anchor_cluster.py +++ b/tools/anchor_cluster.py @@ -20,8 +20,7 @@ import os import sys # add python path of PadleDetection to sys.path parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2))) -if parent_path not in sys.path: - sys.path.append(parent_path) +sys.path.insert(0, parent_path) from ppdet.utils.logger import setup_logger logger = setup_logger('ppdet.anchor_cluster') diff --git a/tools/eval.py b/tools/eval.py index bf75555c1..f78e3a4c0 100755 --- a/tools/eval.py +++ b/tools/eval.py @@ -21,8 +21,7 @@ import sys # add python path of PadleDetection to sys.path parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2))) -if parent_path not in sys.path: - sys.path.append(parent_path) +sys.path.insert(0, parent_path) # ignore warning log import warnings diff --git a/tools/eval_mot.py b/tools/eval_mot.py index 4e03eaf1b..fb8e29612 100644 --- a/tools/eval_mot.py +++ b/tools/eval_mot.py @@ -21,8 +21,7 @@ import sys # add python path of PadleDetection to sys.path parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2))) -if parent_path not in sys.path: - sys.path.append(parent_path) +sys.path.insert(0, parent_path) # ignore warning log import warnings diff --git a/tools/export_model.py b/tools/export_model.py index 3420cf27f..c8abfb8da 100644 --- a/tools/export_model.py +++ b/tools/export_model.py @@ -21,8 +21,7 @@ import sys # add python path of PadleDetection to sys.path parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2))) -if parent_path not in sys.path: - sys.path.append(parent_path) +sys.path.insert(0, parent_path) # ignore warning log import warnings diff --git a/tools/infer.py b/tools/infer.py index b24c205ff..74158d1bb 100755 --- a/tools/infer.py +++ b/tools/infer.py @@ -21,8 +21,7 @@ import sys # add python path of PadleDetection to sys.path parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2))) -if parent_path not in sys.path: - sys.path.append(parent_path) +sys.path.insert(0, parent_path) # ignore warning log import warnings diff --git a/tools/infer_mot.py b/tools/infer_mot.py index 74b12fd44..1131bcd07 100644 --- a/tools/infer_mot.py +++ b/tools/infer_mot.py @@ -21,8 +21,7 @@ import sys # add python path of PadleDetection to sys.path parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2))) -if parent_path not in sys.path: - sys.path.append(parent_path) +sys.path.insert(0, parent_path) # ignore warning log import warnings diff --git a/tools/train.py b/tools/train.py index 55aed43ee..56e19d511 100755 --- a/tools/train.py +++ b/tools/train.py @@ -21,8 +21,7 @@ import sys # add python path of PadleDetection to sys.path parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2))) -if parent_path not in sys.path: - sys.path.append(parent_path) +sys.path.insert(0, parent_path) # ignore warning log import warnings -- GitLab