Skip to content

Commit

Permalink
autoShape() speed profiling update (ultralytics#2460)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Mar 14, 2021
1 parent 7a16878 commit 5d6e6f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ def forward(self, x):

class autoShape(nn.Module):
# input-robust model wrapper for passing cv2/np/PIL/torch inputs. Includes preprocessing, inference and NMS
img_size = 640 # inference size (pixels)
conf = 0.25 # NMS confidence threshold
iou = 0.45 # NMS IoU threshold
classes = None # (optional list) filter by class
Expand Down Expand Up @@ -278,7 +277,8 @@ def display(self, pprint=False, show=False, save=False, render=False, save_dir='

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

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

0 comments on commit 5d6e6f7

Please sign in to comment.