diff --git a/ultralytics/engine/predictor.py b/ultralytics/engine/predictor.py index 142fe63..d6b8f69 100644 --- a/ultralytics/engine/predictor.py +++ b/ultralytics/engine/predictor.py @@ -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