Spaces:
Runtime error
Runtime error
oskarastrom
commited on
Commit
•
72d14ec
1
Parent(s):
2ceaa4e
Update inference.py
Browse files- inference.py +7 -2
inference.py
CHANGED
@@ -249,6 +249,11 @@ def do_confidence_boost(inference, safe_preds, gp=None, batch_size=BATCH_SIZE, c
|
|
249 |
if (gp): gp(0, "Confidence Boost...")
|
250 |
# keep predictions to feed them ordered into the Tracker
|
251 |
# TODO: how to deal with large files?
|
|
|
|
|
|
|
|
|
|
|
252 |
outputs = []
|
253 |
with tqdm(total=len(inference), desc="Running confidence boost", ncols=0, disable=not verbose) as pbar:
|
254 |
for batch_i in range(len(inference)):
|
@@ -266,9 +271,9 @@ def do_confidence_boost(inference, safe_preds, gp=None, batch_size=BATCH_SIZE, c
|
|
266 |
has_next_batch = batch_i+1 < len(inference)
|
267 |
has_prev_batch = batch_i-1 >= 0
|
268 |
|
269 |
-
frames = [None, None]
|
270 |
|
271 |
-
for dt in
|
|
|
272 |
idx = i+dt
|
273 |
temp_frame = None
|
274 |
if idx >= 0 and idx < len(infer):
|
|
|
249 |
if (gp): gp(0, "Confidence Boost...")
|
250 |
# keep predictions to feed them ordered into the Tracker
|
251 |
# TODO: how to deal with large files?
|
252 |
+
|
253 |
+
|
254 |
+
boost_cutoff = 0.01
|
255 |
+
boost_range = math.floor(math.sqrt(1/conf_decay * math.log(conf_power / boost_cutoff)))
|
256 |
+
|
257 |
outputs = []
|
258 |
with tqdm(total=len(inference), desc="Running confidence boost", ncols=0, disable=not verbose) as pbar:
|
259 |
for batch_i in range(len(inference)):
|
|
|
271 |
has_next_batch = batch_i+1 < len(inference)
|
272 |
has_prev_batch = batch_i-1 >= 0
|
273 |
|
|
|
274 |
|
275 |
+
for dt in range(-boost_range, boost_range+1):
|
276 |
+
if dt == 0: continue
|
277 |
idx = i+dt
|
278 |
temp_frame = None
|
279 |
if idx >= 0 and idx < len(infer):
|