diff --git a/export.py b/export.py index 2d4a68e..7517dc4 100644 --- a/export.py +++ b/export.py @@ -61,7 +61,8 @@ FILE = Path(__file__).resolve() ROOT = FILE.parents[0] # YOLOv5 root directory if str(ROOT) not in sys.path: sys.path.append(str(ROOT)) # add ROOT to PATH -ROOT = Path(os.path.relpath(ROOT, Path.cwd())) # relative +if platform.system() != 'Windows': + ROOT = Path(os.path.relpath(ROOT, Path.cwd())) # relative from models.common import Conv from models.experimental import attempt_load diff --git a/models/yolo.py b/models/yolo.py index 9f4701c..11e17d2 100644 --- a/models/yolo.py +++ b/models/yolo.py @@ -7,6 +7,8 @@ Usage: """ import argparse +import os +import platform import sys from copy import deepcopy from pathlib import Path @@ -15,7 +17,8 @@ FILE = Path(__file__).resolve() ROOT = FILE.parents[1] # YOLOv5 root directory if str(ROOT) not in sys.path: sys.path.append(str(ROOT)) # add ROOT to PATH -# ROOT = ROOT.relative_to(Path.cwd()) # relative +if platform.system() != 'Windows': + ROOT = Path(os.path.relpath(ROOT, Path.cwd())) # relative from models.common import * from models.experimental import *