Fix counter overflow for video frame crop names, set default separator for same-frame detection counter (#3982)

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
single_channel
Ketil Malde 1 year ago committed by GitHub
parent b5ea8ce872
commit fa5c8f2764
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -105,6 +105,7 @@ class BasePredictor:
self.results = None
self.transforms = None
self.callbacks = _callbacks or callbacks.get_default_callbacks()
self.txt_path = None
callbacks.add_integration_callbacks(self)
def get_save_dir(self):
@ -178,7 +179,8 @@ class BasePredictor:
if self.args.save_txt:
result.save_txt(f'{self.txt_path}.txt', save_conf=self.args.save_conf)
if self.args.save_crop:
result.save_crop(save_dir=self.save_dir / 'crops', file_name=self.data_path.stem)
result.save_crop(save_dir=self.save_dir / 'crops',
file_name=self.data_path.stem + ('' if self.dataset.mode == 'image' else f'_{frame}'))
return log_string

Loading…
Cancel
Save