Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip_package_creation_second_attempt #3773

Merged
merged 20 commits into from
Jun 26, 2021
Prev Previous commit
Next Next commit
sys append fixes
  • Loading branch information
SkalskiP committed Jun 25, 2021
commit bfcc3c58e2b0c3fe5217211a2b4e82caf316fbe7
3 changes: 2 additions & 1 deletion yolov5/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
import torch.backends.cudnn as cudnn

FILE = Path(__file__).absolute()
sys.path.append(FILE.parents[0].as_posix()) # add yolov5/ to path
# appending pip package root directory to path to support legacy way of running script
sys.path.append(FILE.parent.parent.as_posix())

from yolov5.models.experimental import attempt_load
from yolov5.utils.datasets import LoadStreams, LoadImages
Expand Down
3 changes: 2 additions & 1 deletion yolov5/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
from torch.utils.mobile_optimizer import optimize_for_mobile

FILE = Path(__file__).absolute()
sys.path.append(FILE.parents[0].as_posix()) # add yolov5/ to path
# appending pip package root directory to path to support legacy way of running script
sys.path.append(FILE.parent.parent.as_posix())

from yolov5.models.common import Conv
from yolov5.models.yolo import Detect
Expand Down
3 changes: 2 additions & 1 deletion yolov5/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
from tqdm import tqdm

FILE = Path(__file__).absolute()
sys.path.append(FILE.parents[0].as_posix()) # add yolov5/ to path
# appending pip package root directory to path to support legacy way of running script
sys.path.append(FILE.parent.parent.as_posix())

from yolov5.models.experimental import attempt_load
from yolov5.utils.datasets import create_dataloader
Expand Down
3 changes: 2 additions & 1 deletion yolov5/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
from tqdm import tqdm

FILE = Path(__file__).absolute()
sys.path.append(FILE.parent.parent.as_posix()) # add yolov5/ to path
# appending pip package root directory to path to support legacy way of running script
sys.path.append(FILE.parent.parent.as_posix())

from yolov5 import test # for end-of-epoch mAP
from yolov5.models.experimental import attempt_load
Expand Down