Skip to content

Commit 159efd6

Browse files
author
(Ian Stenbit)
committed
reformat with format script
1 parent 4245e3d commit 159efd6

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

keras_cv/metrics/coco/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ def update_state(self, y_true, y_pred, sample_weight=None):
151151
false_positives = tf.cast(pred_matches == -1, tf.float32)
152152

153153
true_positives_sum = tf.math.reduce_sum(true_positives, axis=-1)
154-
false_positives_sum = tf.math.reduce_sum(false_positives, axis=-1)
154+
false_positives_sum = tf.math.reduce_sum(
155+
false_positives, axis=-1
156+
)
155157

156158
true_positives_update = tf.tensor_scatter_nd_add(
157159
true_positives_update, [indices], [true_positives_sum]

keras_cv/metrics/coco/recall_test.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@
2121

2222

2323
class COCORecallTest(tf.test.TestCase):
24-
2524
def test_runs_inside_model(self):
26-
i = keras.layers.Input((None, None, 6))
25+
i = keras.layers.Input((None, None, 6))
2726
model = keras.Model(i, i)
2827

2928
recall = COCORecall(
@@ -33,7 +32,9 @@ def test_runs_inside_model(self):
3332
)
3433

3534
# These would match if they were in the area range
36-
y_true = np.array([[[0, 0, 10, 10, 1], [5, 5, 10, 10, 1]]]).astype(np.float32)
35+
y_true = np.array([[[0, 0, 10, 10, 1], [5, 5, 10, 10, 1]]]).astype(
36+
np.float32
37+
)
3738
y_pred = np.array([[[0, 0, 10, 10, 1, 1.0], [5, 5, 10, 10, 1, 0.9]]]).astype(
3839
np.float32
3940
)
@@ -51,7 +52,9 @@ def test_recall_area_range_filtering(self):
5152
)
5253

5354
# These would match if they were in the area range
54-
y_true = np.array([[[0, 0, 10, 10, 1], [5, 5, 10, 10, 1]]]).astype(np.float32)
55+
y_true = np.array([[[0, 0, 10, 10, 1], [5, 5, 10, 10, 1]]]).astype(
56+
np.float32
57+
)
5558
y_pred = np.array([[[0, 0, 10, 10, 1, 1.0], [5, 5, 10, 10, 1, 0.9]]]).astype(
5659
np.float32
5760
)

0 commit comments

Comments
 (0)