Skip to content

Commit

Permalink
Fix bug that caused incorrect counts
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Valmadre committed Nov 3, 2020
1 parent 02ba3da commit 6597e8a
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions motmetrics/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,14 @@ def compute_euc(a, b):
oids = np.empty(0)
hids = np.empty(0)
dists = np.empty((0, 0))

fgt = fid_to_fgt.get(fid, None)
fdt = fid_to_fdt.get(fid, None)
if fgt is not None and fdt is not None:
oids = fgt.index.get_level_values(1)
hids = fdt.index.get_level_values(1)
if len(oids) > 0 and len(hids) > 0:
# dists = compute_dist(fgt[distfields].values, fdt[distfields].values)
dists = compute_dist(fgt.values, fdt.values)

if fid in fid_to_fgt:
fgt = fid_to_fgt[fid]
oids = fgt.index.get_level_values('Id')
if fid in fid_to_fdt:
fdt = fid_to_fdt[fid]
hids = fdt.index.get_level_values('Id')
if len(oids) > 0 and len(hids) > 0:
dists = compute_dist(fgt.values, fdt.values)
acc.update(oids, hids, dists, frameid=fid)

return acc
Expand Down

0 comments on commit 6597e8a

Please sign in to comment.