Skip to content

Commit 63c011e

Browse files
authored
Merge pull request #16 from JoOkuma/jookuma/removing-scalar-conversion-warning
Using .item() for scalar casting
2 parents c0b6274 + 7af85df commit 63c011e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ctc_metrics/utils/representations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def create_edge_mapping(
197197
label1, _, end1, _ = tracks[tracks[:, 0] == parent2][0]
198198
ind1 = np.argwhere(labels[end1] == label1)[0] + cum_inds[end1]
199199
ind2 = np.argwhere(labels[birth2] == label2)[0] + cum_inds[birth2]
200-
ind1, ind2 = int(ind1), int(ind2)
200+
ind1, ind2 = ind1.item(), ind2.item()
201201
edges = np.asarray(
202202
[ind1, label1, int(V_tp[ind1]), end1, ind2, label2, int(V_tp[ind2]), birth2, 1]
203203
)[None, :]
@@ -374,7 +374,7 @@ def assign_comp_to_ref(
374374
):
375375
for i in l_gt:
376376
if i in m_gt:
377-
m = m_res[int(np.argwhere(np.asarray(m_gt) == i)[0])]
377+
m = m_res[np.argwhere(np.asarray(m_gt) == i)[0].item()]
378378
track_assignments[i][frame] = m
379379
counts = np.sum(np.asarray(m_res) == m)
380380
if counts > 1:

0 commit comments

Comments
 (0)