Spaces:
Runtime error
Runtime error
Commit
•
ad6a33a
1
Parent(s):
57a0c0b
fixed learn.no_bar() error
Browse files- detector.py +3 -3
detector.py
CHANGED
@@ -73,11 +73,11 @@ def bat_detector(img):
|
|
73 |
|
74 |
# temp = pathlib.PosixPath
|
75 |
# pathlib.PosixPath = pathlib.WindowsPath
|
76 |
-
|
77 |
-
learn = load_learner("model.pkl")
|
78 |
|
79 |
for bat in cropped_bats:
|
80 |
-
|
|
|
81 |
p1=f"{probs[0]:.4f}"
|
82 |
p2=f"{probs[1]:.4f}"
|
83 |
if label == '!bat' and p1 > '0.5':
|
|
|
73 |
|
74 |
# temp = pathlib.PosixPath
|
75 |
# pathlib.PosixPath = pathlib.WindowsPath
|
76 |
+
learn = load_learner("model.pkl")
|
|
|
77 |
|
78 |
for bat in cropped_bats:
|
79 |
+
with learn.no_bar(), learn.no_logging():
|
80 |
+
label, _, probs = learn.predict(bat)
|
81 |
p1=f"{probs[0]:.4f}"
|
82 |
p2=f"{probs[1]:.4f}"
|
83 |
if label == '!bat' and p1 > '0.5':
|