Skip to content

Commit

Permalink
python 3.9 Path().is_relative_to() removal
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Sep 28, 2021
1 parent e2bd565 commit 938b39b
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
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()) if ROOT.is_relative_to(Path.cwd()) else ROOT # relative
ROOT = ROOT.relative_to(Path.cwd()) # relative

from models.experimental import attempt_load
from utils.datasets import LoadImages, LoadStreams
Expand Down
2 changes: 1 addition & 1 deletion export.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
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()) if ROOT.is_relative_to(Path.cwd()) else ROOT # relative
ROOT = ROOT.relative_to(Path.cwd()) # relative

from models.common import Conv
from models.experimental import attempt_load
Expand Down
2 changes: 1 addition & 1 deletion models/tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
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()) if ROOT.is_relative_to(Path.cwd()) else ROOT # relative
ROOT = ROOT.relative_to(Path.cwd()) # relative

import numpy as np
import tensorflow as tf
Expand Down
2 changes: 1 addition & 1 deletion models/yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
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()) if ROOT.is_relative_to(Path.cwd()) else ROOT # relative
ROOT = ROOT.relative_to(Path.cwd()) # relative

from models.common import *
from models.experimental import *
Expand Down
2 changes: 1 addition & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
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()) if ROOT.is_relative_to(Path.cwd()) else ROOT # relative
ROOT = ROOT.relative_to(Path.cwd()) # relative

import val # for end-of-epoch mAP
from models.experimental import attempt_load
Expand Down
2 changes: 1 addition & 1 deletion val.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
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()) if ROOT.is_relative_to(Path.cwd()) else ROOT # relative
ROOT = ROOT.relative_to(Path.cwd()) # relative

from models.experimental import attempt_load
from utils.datasets import create_dataloader
Expand Down

0 comments on commit 938b39b

Please sign in to comment.