Skip to content

Commit 059df93

Browse files
committed
fix: fix pep8 issues
1 parent 89b3251 commit 059df93

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

openfoodfacts/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ def __init__(
586586

587587
if isinstance(version, APIVersion):
588588
version = version.value
589-
589+
590590
self.api_config = APIConfig(
591591
user_agent=user_agent,
592592
country=country,

openfoodfacts/ml/object_detection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,12 @@ def apply_nms(
166166
167167
We use `NMSBoxes` from the openCV library to perform NMS.
168168
169-
:param bboxes: The bounding boxes in format [y_min, x_min, y_max, x_max], in relative
170-
coordinates. Shape: (N, 4)
169+
:param bboxes: The bounding boxes in format [y_min, x_min, y_max, x_max],
170+
in relative coordinates. Shape: (N, 4)
171171
:param scores: The confidence scores. Shape: (N,)
172172
:param classes: The class labels, as an int array. Shape: (N,)
173-
:param threshold: The confidence threshold to use to filter out the bounding boxes.
174-
Shape: (N,)
173+
:param threshold: The confidence threshold to use to filter out the
174+
bounding boxes. Shape: (N,)
175175
:param nms_threshold: The NMS threshold to use.
176176
:param nms_eta: The NMS eta to use.
177177
:return: bounding boxes, scores, classes after NMS

tests/ml/test_object_detection.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,8 @@ def test_nms_keeps_highest_score_in_cluster(self):
296296
assert result_classes[0] == 0
297297

298298
def test_bbbox_format_conversion(self):
299-
"""Test that bbox format conversion is correct (y_min,x_min,y_max,x_max) -> (x,y,w,h)."""
299+
"""Test that bbox format conversion is correct
300+
(y_min,x_min,y_max,x_max) -> (x,y,w,h)."""
300301
# This test verifies the internal conversion in apply_nms
301302
bboxes = np.array([[0.0, 0.0, 1.0, 1.0]], dtype=np.float32) # Full image
302303
scores = np.array([1.0], dtype=np.float32)

0 commit comments

Comments
 (0)