From b81e3c4424ab19aec6f523e6fcd4edb8c390f60a Mon Sep 17 00:00:00 2001 From: abdulhakkeempa Date: Tue, 5 Mar 2024 21:22:14 +0530 Subject: [PATCH 1/3] fix: updates the posix path on windows os --- detect.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/detect.py b/detect.py index c58aa80a68fc..f97366fbb278 100644 --- a/detect.py +++ b/detect.py @@ -34,9 +34,16 @@ import platform import sys from pathlib import Path +import pathlib import torch +# PosixPath on Windows +if sys.platform == "win32": + temp = pathlib.PosixPath + pathlib.PosixPath = pathlib.WindowsPath + del temp + FILE = Path(__file__).resolve() ROOT = FILE.parents[0] # YOLOv5 root directory if str(ROOT) not in sys.path: From cd70d911433f9b7a1e3fb91dac4d74359f9997e0 Mon Sep 17 00:00:00 2001 From: abdulhakkeempa Date: Tue, 5 Mar 2024 21:22:33 +0530 Subject: [PATCH 2/3] fix: updates the posix path on windows os --- detect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detect.py b/detect.py index f97366fbb278..0ad822297ca3 100644 --- a/detect.py +++ b/detect.py @@ -38,7 +38,7 @@ import torch -# PosixPath on Windows +# Updating PosixPath on Windows for compatibility if sys.platform == "win32": temp = pathlib.PosixPath pathlib.PosixPath = pathlib.WindowsPath From d7d547c7af18ec028ca510b3bea65d2482b7df7c Mon Sep 17 00:00:00 2001 From: UltralyticsAssistant Date: Sun, 28 Apr 2024 15:19:50 +0000 Subject: [PATCH 3/3] Auto-format by https://ultralytics.com/actions --- detect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detect.py b/detect.py index 0ad822297ca3..19b16c897c09 100644 --- a/detect.py +++ b/detect.py @@ -31,10 +31,10 @@ import argparse import csv import os +import pathlib import platform import sys from pathlib import Path -import pathlib import torch