diff --git a/tools/anchor_cluster.py b/tools/anchor_cluster.py index 78ed3ea07dd348975054979000955074d914ccdd..688c37fad0dd1d2c12e1d6b71a0fbf3d94f262a4 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 bf75555c1149249101cf47f655ce145792047bcc..f78e3a4c099407d5f4403f9b6abff9c3fbcc74da 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 4e03eaf1b0f6b61e74a460dabf605daf76932e4e..fb8e296124dd9ef5470216e4d00161446b8349be 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 3420cf27f810c7f325e0b35a31b790f594803749..c8abfb8da064c6a516e395993e6da01e36fb42dc 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 b24c205ff23196d2bd884646ca7d1f4474ef2a28..74158d1bb68eeeac74cbac51807c36900ddfcc5f 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 74b12fd4437044b6f5c254dd8b24e98790c9b39b..1131bcd0751560a54d9fd8a69ea8e5edd4429fe8 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 55aed43ee032cde13f66cb2288fb3e412c9f70db..56e19d511ad9e6269536f45a3958f17301c3aab7 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