Skip to content

Commit b058368

Browse files
pre-commit-ci[bot]Borda
authored andcommitted
fix(pre_commit): 🎨 auto format pre-commit hooks
1 parent e0f4979 commit b058368

File tree

5 files changed

+8
-12
lines changed

5 files changed

+8
-12
lines changed

β€Žexamples/compact_mask/README.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ reported as theoretical `NxHxW` bytes.
198198
- **Compact actual** β€” `tracemalloc` peak during `CompactMask.from_dense()`, including Python object overhead (~2x theoretical for small object counts)
199199
- **Mem x** β€” dense / compact theoretical ratio
200200
- **Area x** β€” `.area` speedup; RLE sums True-pixel counts with no materialisation
201-
- **Annot Γ—** β€” `MaskAnnotator` speedup; crop-paint avoids full-frame allocation
201+
- **Annot x** β€” `MaskAnnotator` speedup; crop-paint avoids full-frame allocation
202202
- **N/A** β€” dense timing skipped (array > 12 GB)
203203

204204
All non-skipped scenarios pass: pixel-perfect annotation, exact area,

β€Žexamples/compact_mask/benchmark.pyβ€Ž

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -481,19 +481,15 @@ def stage_merge(
481481
half = len(det_compact) // 2
482482
compact_a, compact_b = det_compact[:half], det_compact[half:]
483483

484-
compact_merge_s = time_reps(
485-
lambda: sv.Detections.merge([compact_a, compact_b])
486-
)
484+
compact_merge_s = time_reps(lambda: sv.Detections.merge([compact_a, compact_b]))
487485
if dense_skipped or det_dense is None:
488486
return math.nan, compact_merge_s, None
489487

490488
dense_a, dense_b = det_dense[:half], det_dense[half:]
491489
merged_d = sv.Detections.merge([dense_a, dense_b])
492490
merged_c = sv.Detections.merge([compact_a, compact_b])
493491
merge_ok = bool(np.allclose(merged_d.area, merged_c.area))
494-
dense_merge_s = time_reps(
495-
lambda: sv.Detections.merge([dense_a, dense_b])
496-
)
492+
dense_merge_s = time_reps(lambda: sv.Detections.merge([dense_a, dense_b]))
497493
return dense_merge_s, compact_merge_s, merge_ok
498494

499495

β€Žexamples/time_in_zone/README.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ Script to run object detection on an RTSP stream using the RF-DETR model.
222222
- `--model_size`: RF-DETR backbone size to load β€” choose from 'nano', 'small', 'medium', 'base', or 'large' (default 'medium').
223223
- `--device`: Compute device to run the model on ('cpu', 'mps', or 'cuda'; default 'cpu').
224224
- `--classes`: Space-separated list of class IDs to track. Leave empty to track all classes.
225-
- `--confidence_threshold`: Minimum confidence score for a detection to be kept, range 0–1 (default 0.3).
225+
- `--confidence_threshold`: Minimum confidence score for a detection to be kept, range 0-1 (default 0.3).
226226
- `--iou_threshold`: IOU threshold applied during non-max suppression (default 0.7).
227227
- `--resolution`: Shortest-side input resolution supplied to the model. The script will round it to the nearest valid multiple (default 640).
228228

β€Žsrc/supervision/detection/utils/masks.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ def filter_segments_by_distance(
365365
366366
```
367367
368-
The nearby 2Γ—2 block at columns 6–7 is kept because its edge distance
368+
The nearby 2x2 block at columns 6-7 is kept because its edge distance
369369
is within 3 pixels. The distant block at columns 9-10 is removed.
370370
""" # noqa E501 // docs
371371
if mask.dtype != bool:

β€Žtests/detection/test_compact_mask.pyβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,13 +430,13 @@ def test_repack_tightens_loose_bbox(self) -> None:
430430
"""repack() shrinks the crop to the minimal True-pixel rectangle."""
431431
h, w = 20, 20
432432
masks = np.zeros((1, h, w), dtype=bool)
433-
masks[0, 5:10, 6:12] = True # True block at (5,6)–(9,11)
433+
masks[0, 5:10, 6:12] = True # True block at (5,6)-(9,11)
434434

435435
# Deliberately loose bbox covers full image.
436436
xyxy = np.array([[0, 0, w - 1, h - 1]], dtype=np.float32)
437437
cm = CompactMask.from_dense(masks, xyxy, image_shape=(h, w))
438438

439-
# Before repack: crop is the full 20Γ—20 image.
439+
# Before repack: crop is the full 20x20 image.
440440
assert cm._crop_shapes[0].tolist() == [20, 20]
441441

442442
repacked = cm.repack()
@@ -448,7 +448,7 @@ def test_repack_tightens_loose_bbox(self) -> None:
448448
np.testing.assert_array_equal(repacked.to_dense(), masks)
449449

450450
def test_repack_preserves_all_false_mask(self) -> None:
451-
"""repack() normalises an all-False mask to a 1Γ—1 crop."""
451+
"""repack() normalises an all-False mask to a 1x1 crop."""
452452
h, w = 10, 10
453453
masks = np.zeros((2, h, w), dtype=bool)
454454
masks[1, 3:6, 3:6] = True # only mask 1 is non-empty

0 commit comments

Comments
Β (0)