glenn-jocher commited on
Commit
be67572
β€’
1 Parent(s): 7043872

Enable `results.print()` when `_verbose=False` (#7558)

Browse files

Follows implementation of _verbose flag for PyTorch Hub models. Currently these are so silent that result.print() does nothing πŸ˜‚

Files changed (1) hide show
  1. models/common.py +2 -3
models/common.py CHANGED
@@ -629,7 +629,7 @@ class Detections:
629
 
630
  im = Image.fromarray(im.astype(np.uint8)) if isinstance(im, np.ndarray) else im # from np
631
  if pprint:
632
- LOGGER.info(s.rstrip(', '))
633
  if show:
634
  im.show(self.files[i]) # show
635
  if save:
@@ -646,8 +646,7 @@ class Detections:
646
 
647
  def print(self):
648
  self.display(pprint=True) # print results
649
- LOGGER.info(f'Speed: %.1fms pre-process, %.1fms inference, %.1fms NMS per image at shape {tuple(self.s)}' %
650
- self.t)
651
 
652
  def show(self, labels=True):
653
  self.display(show=True, labels=labels) # show results
 
629
 
630
  im = Image.fromarray(im.astype(np.uint8)) if isinstance(im, np.ndarray) else im # from np
631
  if pprint:
632
+ print(s.rstrip(', '))
633
  if show:
634
  im.show(self.files[i]) # show
635
  if save:
 
646
 
647
  def print(self):
648
  self.display(pprint=True) # print results
649
+ print(f'Speed: %.1fms pre-process, %.1fms inference, %.1fms NMS per image at shape {tuple(self.s)}' % self.t)
 
650
 
651
  def show(self, labels=True):
652
  self.display(show=True, labels=labels) # show results