General ultralytics==8.0.6 updates (#351)

Co-authored-by: Dzmitry Plashchynski <plashchynski@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Glenn Jocher
2023-01-14 17:39:50 +01:00
committed by GitHub
parent 70427579b8
commit f8e32c4c13
16 changed files with 79 additions and 80 deletions

View File

@ -240,7 +240,7 @@ class BasePredictor:
if isinstance(self.vid_writer[idx], cv2.VideoWriter):
self.vid_writer[idx].release() # release previous video writer
if vid_cap: # video
fps = vid_cap.get(cv2.CAP_PROP_FPS)
fps = int(vid_cap.get(cv2.CAP_PROP_FPS)) # integer required, floats produce error in MP4 codec
w = int(vid_cap.get(cv2.CAP_PROP_FRAME_WIDTH))
h = int(vid_cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
else: # stream

View File

@ -506,10 +506,12 @@ class BaseTrainer:
def check_resume(self):
resume = self.args.resume
if resume:
last = Path(check_file(resume) if isinstance(resume, str) else get_latest_run())
last = Path(check_file(resume) if isinstance(resume, (str, Path)) else get_latest_run())
args_yaml = last.parent.parent / 'args.yaml' # train options yaml
if args_yaml.is_file():
args = get_config(args_yaml) # replace
assert args_yaml.is_file(), \
FileNotFoundError('Resume checkpoint f{last} not found. '
'Please pass a valid checkpoint to resume from, i.e. yolo resume=path/to/last.pt')
args = get_config(args_yaml) # replace
args.model, resume = str(last), True # reinstate
self.args = args
self.resume = resume