Allow YOLOv5 execution from arbitrary cwd (#4954)

* Allow YOLOv5 execution from arbitrary `cwd`

* Fix str bugs
This commit is contained in:
Glenn Jocher authored and GitHub committed 2021-09-27 17:40:20 -07:00
1 parent a820b43aca
commit 4e04cb0dc8
4 files changed
+23 -17

No files matched your search

+1
View File
@@ -34,6 +34,7 @@ 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 = ROOT.relative_to(Path.cwd()) # relative
from models.common import Conv
from models.experimental import attempt_load