Skip to content

Add object detection, tracking, mobile notifications, and search to any security camera.

fix 0 default on install

roryclear929f995b3ffa
diff --git a/clearcam/Yolo.m b/clearcam/Yolo.m
index 01ba2cc..7f0be91 100644
--- a/clearcam/Yolo.m
+++ b/clearcam/Yolo.m
@@ -182,7 +182,7 @@ UInt8 *rgbData;
}
//if (prob < 0.25) continue;
- if (prob < (double)[[NSUserDefaults standardUserDefaults] integerForKey:@"threshold"] / 100.0) continue; // Use the dynamic threshold
+ if (prob < ([[NSUserDefaults standardUserDefaults] objectForKey:@"threshold"] ? [[NSUserDefaults standardUserDefaults] integerForKey:@"threshold"] / 100.0 : 0.25)) continue;
float xc = output[index];
float yc = output[numPredictions + index];