Browse Source

Replace `path.absolute()` with `path.resolve()` (#4763)

modifyDataloader
Glenn Jocher GitHub 3 years ago
parent
commit
c47be26f34
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 11 additions and 11 deletions
  1. +1
    -1
      detect.py
  2. +1
    -1
      export.py
  3. +1
    -1
      hubconf.py
  4. +1
    -1
      models/yolo.py
  5. +1
    -1
      train.py
  6. +1
    -1
      utils/__init__.py
  7. +1
    -1
      utils/datasets.py
  8. +1
    -1
      utils/general.py
  9. +1
    -1
      utils/loggers/wandb/sweep.py
  10. +1
    -1
      utils/loggers/wandb/wandb_utils.py
  11. +1
    -1
      val.py

+ 1
- 1
detect.py View File

@@ -15,7 +15,7 @@ import numpy as np
import torch
import torch.backends.cudnn as cudnn

FILE = Path(__file__).absolute()
FILE = Path(__file__).resolve()
sys.path.append(FILE.parents[0].as_posix()) # add yolov5/ to path

from models.experimental import attempt_load

+ 1
- 1
export.py View File

@@ -15,7 +15,7 @@ import torch
import torch.nn as nn
from torch.utils.mobile_optimizer import optimize_for_mobile

FILE = Path(__file__).absolute()
FILE = Path(__file__).resolve()
sys.path.append(FILE.parents[0].as_posix()) # add yolov5/ to path

from models.common import Conv

+ 1
- 1
hubconf.py View File

@@ -33,7 +33,7 @@ def _create(name, pretrained=True, channels=3, classes=80, autoshape=True, verbo
from utils.downloads import attempt_download
from utils.torch_utils import select_device

file = Path(__file__).absolute()
file = Path(__file__).resolve()
check_requirements(requirements=file.parent / 'requirements.txt', exclude=('tensorboard', 'thop', 'opencv-python'))
set_logging(verbose=verbose)


+ 1
- 1
models/yolo.py View File

@@ -11,7 +11,7 @@ import sys
from copy import deepcopy
from pathlib import Path

FILE = Path(__file__).absolute()
FILE = Path(__file__).resolve()
sys.path.append(FILE.parents[1].as_posix()) # add yolov5/ to path

from models.common import *

+ 1
- 1
train.py View File

@@ -26,7 +26,7 @@ from torch.nn.parallel import DistributedDataParallel as DDP
from torch.optim import Adam, SGD, lr_scheduler
from tqdm import tqdm

FILE = Path(__file__).absolute()
FILE = Path(__file__).resolve()
sys.path.append(FILE.parents[0].as_posix()) # add yolov5/ to path

import val # for end-of-epoch mAP

+ 1
- 1
utils/__init__.py View File

@@ -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
utils/datasets.py View File

@@ -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
utils/general.py View File

@@ -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=''):

+ 1
- 1
utils/loggers/wandb/sweep.py View File

@@ -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

+ 1
- 1
utils/loggers/wandb/wandb_utils.py View File

@@ -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

+ 1
- 1
val.py View File

@@ -17,7 +17,7 @@ import numpy as np
import torch
from tqdm import tqdm

FILE = Path(__file__).absolute()
FILE = Path(__file__).resolve()
sys.path.append(FILE.parents[0].as_posix()) # add yolov5/ to path

from models.experimental import attempt_load

Loading…
Cancel
Save