Replace path.absolute() with path.resolve() (#4763)
This commit is contained in:
1 parent
cd810c8286
commit
c47be26f34
11 files changed
+11
-11
No files matched your search
+1
-1
@@ -4,7 +4,7 @@
|
||||
# import torch
|
||||
# from PIL import ImageFont
|
||||
#
|
||||
# FILE = Path(__file__).absolute()
|
||||
# FILE = Path(__file__).resolve()
|
||||
# ROOT = FILE.parents[1] # yolov5/ dir
|
||||
# if str(ROOT) not in sys.path:
|
||||
# sys.path.append(str(ROOT)) # add ROOT to PATH
|
||||
|
||||
+1
-1
@@ -156,7 +156,7 @@ class _RepeatSampler(object):
|
||||
|
||||
class LoadImages: # for inference
|
||||
def __init__(self, path, img_size=640, stride=32, auto=True):
|
||||
p = str(Path(path).absolute()) # os-agnostic absolute path
|
||||
p = str(Path(path).resolve()) # os-agnostic absolute path
|
||||
if '*' in p:
|
||||
files = sorted(glob.glob(p, recursive=True)) # glob
|
||||
elif os.path.isdir(p):
|
||||
|
||||
+1
-1
@@ -147,7 +147,7 @@ def is_colab():
|
||||
|
||||
def is_pip():
|
||||
# Is file in a pip package?
|
||||
return 'site-packages' in Path(__file__).absolute().parts
|
||||
return 'site-packages' in Path(__file__).resolve().parts
|
||||
|
||||
|
||||
def is_ascii(s=''):
|
||||
|
||||
@@ -3,7 +3,7 @@ from pathlib import Path
|
||||
|
||||
import wandb
|
||||
|
||||
FILE = Path(__file__).absolute()
|
||||
FILE = Path(__file__).resolve()
|
||||
sys.path.append(FILE.parents[3].as_posix()) # add utils/ to path
|
||||
|
||||
from train import train, parse_opt
|
||||
|
||||
@@ -9,7 +9,7 @@ from pathlib import Path
|
||||
import yaml
|
||||
from tqdm import tqdm
|
||||
|
||||
FILE = Path(__file__).absolute()
|
||||
FILE = Path(__file__).resolve()
|
||||
sys.path.append(FILE.parents[3].as_posix()) # add yolov5/ to path
|
||||
|
||||
from utils.datasets import LoadImagesAndLabels
|
||||
|
||||
Reference in new issue
Block a user