From be6757227911bb98f3cfa5e2947ba8d4532453ef Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 24 Apr 2022 11:30:40 -0700 Subject: [PATCH] Enable `results.print()` when `_verbose=False` (#7558) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follows implementation of _verbose flag for PyTorch Hub models. Currently these are so silent that result.print() does nothing 😂 --- models/common.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/models/common.py b/models/common.py index 6ab82ab51ff4..7eca56aaa3bd 100644 --- a/models/common.py +++ b/models/common.py @@ -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: @@ -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