Replace nosave
and noval
with save
and val
(#127)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -43,7 +43,7 @@ class ClassificationPredictor(BasePredictor):
|
||||
|
||||
# write
|
||||
text = '\n'.join(f'{prob[j]:.2f} {self.model.names[j]}' for j in top5i)
|
||||
if self.save_img or self.args.view_img: # Add bbox to image
|
||||
if self.args.save or self.args.show: # Add bbox to image
|
||||
self.annotator.text((32, 32), text, txt_color=(255, 255, 255))
|
||||
if self.args.save_txt: # Write to file
|
||||
with open(f'{self.txt_path}.txt', 'a') as f:
|
||||
|
@ -66,7 +66,7 @@ class DetectionPredictor(BasePredictor):
|
||||
with open(f'{self.txt_path}.txt', 'a') as f:
|
||||
f.write(('%g ' * len(line)).rstrip() % line + '\n')
|
||||
|
||||
if self.save_img or self.args.save_crop or self.args.view_img: # Add bbox to image
|
||||
if self.args.save or self.args.save_crop or self.args.show: # Add bbox to image
|
||||
c = int(cls) # integer class
|
||||
label = None if self.args.hide_labels else (
|
||||
self.model.names[c] if self.args.hide_conf else f'{self.model.names[c]} {conf:.2f}')
|
||||
|
@ -81,7 +81,7 @@ class SegmentationPredictor(DetectionPredictor):
|
||||
with open(f'{self.txt_path}.txt', 'a') as f:
|
||||
f.write(('%g ' * len(line)).rstrip() % line + '\n')
|
||||
|
||||
if self.save_img or self.args.save_crop or self.args.view_img:
|
||||
if self.args.save or self.args.save_crop or self.args.show:
|
||||
c = int(cls) # integer class
|
||||
label = None if self.args.hide_labels else (
|
||||
self.model.names[c] if self.args.hide_conf else f'{self.model.names[c]} {conf:.2f}')
|
||||
|
Reference in New Issue
Block a user