Update sys.path.append(str(ROOT)) (#4852)
* Update `sys.path.append(str(ROOT))` * Cleanup
This commit is contained in:
1 parent
3732f9ac8a
commit
4d1a2ac87e
10 files changed
+30
-32
No files matched your search
@@ -16,7 +16,9 @@ import torch
|
||||
import torch.backends.cudnn as cudnn
|
||||
|
||||
FILE = Path(__file__).resolve()
|
||||
sys.path.append(FILE.parents[0].as_posix()) # add yolov5/ to path
|
||||
ROOT = FILE.parents[0] # YOLOv5 root directory
|
||||
if str(ROOT) not in sys.path:
|
||||
sys.path.append(str(ROOT)) # add ROOT to PATH
|
||||
|
||||
from models.experimental import attempt_load
|
||||
from utils.datasets import LoadImages, LoadStreams
|
||||
@@ -284,7 +286,7 @@ def parse_opt():
|
||||
|
||||
|
||||
def main(opt):
|
||||
check_requirements(exclude=('tensorboard', 'thop'))
|
||||
check_requirements(requirements=ROOT / 'requirements.txt', exclude=('tensorboard', 'thop'))
|
||||
run(**vars(opt))
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user