jonathan-roos commited on
Commit
45a7f6c
1 Parent(s): b95ca35

added timer foe each learn.predict call

Browse files
Files changed (1) hide show
  1. detector.py +2 -0
detector.py CHANGED
@@ -72,7 +72,9 @@ def bat_detector(img):
72
 
73
  def predict(bat):
74
  with learn.no_bar(), learn.no_logging():
 
75
  _, _, probs = learn.predict(bat)
 
76
  return (tuple(map(lambda x: f"{x:.4f}", probs)))
77
 
78
  filtered_results = filter(lambda x: (x[0] < '0.9' and x[1] > '0.5'), [predict(bat) for bat in cropped_bats]) # x[0] is !bat probability and x[1] is bat probability
 
72
 
73
  def predict(bat):
74
  with learn.no_bar(), learn.no_logging():
75
+ start = time.time()
76
  _, _, probs = learn.predict(bat)
77
+ print(f"{time.time()-start:.4f}s")
78
  return (tuple(map(lambda x: f"{x:.4f}", probs)))
79
 
80
  filtered_results = filter(lambda x: (x[0] < '0.9' and x[1] > '0.5'), [predict(bat) for bat in cropped_bats]) # x[0] is !bat probability and x[1] is bat probability