You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importosimportnumpyasnpimportmotmetricsasmmdefcompute_motchallenge(gt_file, test_file):
df_gt=mm.io.loadtxt(gt_file)
df_test=mm.io.loadtxt(test_file)
# Define thresholds for matchingth_list=np.arange(0.05, 0.99, 0.05)
# Compare ground truth and test datares_list=mm.utils.compare_to_groundtruth_reweighting(df_gt, df_test, "iou", distth=th_list)
returnres_listdefprocess_multiple_files(gt_files, test_files):
accumulators= []
forgt_file, test_fileinzip(gt_files, test_files):
acc=compute_motchallenge(gt_file, test_file)
accumulators.append(acc)
returnaccumulatorsgt_files= ['./gt.txt']
test_files= ['./test.txt']
accumulators=process_multiple_files(gt_files, test_files)
mh=mm.metrics.create()
summary=mh.compute_many(
acc,
metrics=[
"deta_alpha",
"assa_alpha",
"hota_alpha",
],
generate_overall=True, # `Overall` is the average we need only
)
strsummary=mm.io.render_summary(
summary.iloc[[-1], :], # Use list to preserve `DataFrame` typeformatters=mh.formatters,
namemap={"hota_alpha": "HOTA", "assa_alpha": "ASSA", "deta_alpha": "DETA"},
)
print(strsummary)
but I get the following error:
File "/Users/mikel.brostrom/boxmot/try_pymotmetrics.py", line 14, in compute_motchallenge
res_list = mm.utils.compare_to_groundtruth_reweighting(df_gt, df_test, "iou", distth=th_list)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/mikel.brostrom/Library/Caches/pypoetry/virtualenvs/boxmot-YDNZdsaB-py3.11/lib/python3.11/site-packages/motmetrics/utils.py", line 156, in compare_to_groundtruth_reweighting
acc.update(oids, hids, 1 - weighted_dists, frameid=fid, similartiy_matrix=dists, th=th)
^^^^^
UnboundLocalError: cannot access local variable 'dists' where it is not associated with a value
I am running this:
but I get the following error:
The files used:
gt.txt
test.txt
Any idea what the error may be here @Justin900429. Just following the README 😄
The text was updated successfully, but these errors were encountered: