Skip to content

Commit 97cd726

Browse files
Y-T-Gglenn-jocher
andauthored
Update IoU threshold to match Ultralytics default (#193)
* Update IoU threshold to match Ultralytics default Signed-off-by: Mohammed Yasin <[email protected]> * Update BasePredictor.swift * Update IOU threshold in BasePredictorTests Signed-off-by: Mohammed Yasin <[email protected]> --------- Signed-off-by: Mohammed Yasin <[email protected]> Co-authored-by: Glenn Jocher <[email protected]>
1 parent a97e02d commit 97cd726

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Sources/YOLO/BasePredictor.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,10 @@ public class BasePredictor: Predictor, @unchecked Sendable {
253253
confidenceThreshold = confidence
254254
}
255255

256-
/// The IoU (Intersection over Union) threshold for non-maximum suppression (default: 0.4).
256+
/// The IoU (Intersection over Union) threshold for non-maximum suppression (default: 0.7).
257257
///
258258
/// Used to filter overlapping detections during non-maximum suppression.
259-
var iouThreshold = 0.4
259+
var iouThreshold = 0.7
260260

261261
/// Sets the IoU threshold for non-maximum suppression.
262262
///

Tests/YOLOTests/BasePredictorTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class BasePredictorTests: XCTestCase {
1616
XCTAssertFalse(predictor.isModelLoaded)
1717
XCTAssertEqual(predictor.labels.count, 0)
1818
XCTAssertEqual(predictor.confidenceThreshold, 0.25, accuracy: 0.001)
19-
XCTAssertEqual(predictor.iouThreshold, 0.4, accuracy: 0.001)
19+
XCTAssertEqual(predictor.iouThreshold, 0.7, accuracy: 0.001)
2020
XCTAssertEqual(predictor.numItemsThreshold, 30)
2121
XCTAssertFalse(predictor.isUpdating)
2222
XCTAssertNil(predictor.currentBuffer)

0 commit comments

Comments
 (0)