Skip to content

Commit

Permalink
Enable results.print() when _verbose=False (ultralytics#7558)
Browse files Browse the repository at this point in the history
Follows implementation of _verbose flag for PyTorch Hub models. Currently these are so silent that result.print() does nothing πŸ˜‚
  • Loading branch information
glenn-jocher authored and Clay Januhowski committed Sep 8, 2022
1 parent ee04637 commit db47205
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ def display(self, pprint=False, show=False, save=False, crop=False, render=False

im = Image.fromarray(im.astype(np.uint8)) if isinstance(im, np.ndarray) else im # from np
if pprint:
LOGGER.info(s.rstrip(', '))
print(s.rstrip(', '))
if show:
im.show(self.files[i]) # show
if save:
Expand All @@ -646,8 +646,7 @@ def display(self, pprint=False, show=False, save=False, crop=False, render=False

def print(self):
self.display(pprint=True) # print results
LOGGER.info(f'Speed: %.1fms pre-process, %.1fms inference, %.1fms NMS per image at shape {tuple(self.s)}' %
self.t)
print(f'Speed: %.1fms pre-process, %.1fms inference, %.1fms NMS per image at shape {tuple(self.s)}' % self.t)

def show(self, labels=True):
self.display(show=True, labels=labels) # show results
Expand Down

0 comments on commit db47205

Please sign in to comment.