glenn-jocher commited on
Commit
f813f6d
·
unverified ·
1 Parent(s): 569757e

autoShape() speed profiling update (#2460)

Browse files
Files changed (1) hide show
  1. models/common.py +2 -2
models/common.py CHANGED
@@ -168,7 +168,6 @@ class NMS(nn.Module):
168
 
169
  class autoShape(nn.Module):
170
  # input-robust model wrapper for passing cv2/np/PIL/torch inputs. Includes preprocessing, inference and NMS
171
- img_size = 640 # inference size (pixels)
172
  conf = 0.25 # NMS confidence threshold
173
  iou = 0.45 # NMS IoU threshold
174
  classes = None # (optional list) filter by class
@@ -278,7 +277,8 @@ class Detections:
278
 
279
  def print(self):
280
  self.display(pprint=True) # print results
281
- print(f'Speed: %.1f/%.1f/%.1f ms pre-process/inference/NMS per image at shape {tuple(self.s)}' % tuple(self.t))
 
282
 
283
  def show(self):
284
  self.display(show=True) # show results
 
168
 
169
  class autoShape(nn.Module):
170
  # input-robust model wrapper for passing cv2/np/PIL/torch inputs. Includes preprocessing, inference and NMS
 
171
  conf = 0.25 # NMS confidence threshold
172
  iou = 0.45 # NMS IoU threshold
173
  classes = None # (optional list) filter by class
 
277
 
278
  def print(self):
279
  self.display(pprint=True) # print results
280
+ print(f'Speed: %.1fms pre-process, %.1fms inference, %.1fms NMS per image at shape {tuple(self.s)}' %
281
+ tuple(self.t))
282
 
283
  def show(self):
284
  self.display(show=True) # show results