cheind / py-motmetrics

:bar_chart: Benchmark multiple object trackers (MOT) in Python
MIT License
1.37k stars 258 forks source link

KeyError: 'Sequence' #96

Closed RonaldGalea closed 4 years ago

RonaldGalea commented 4 years ago

Hello, I am trying to evaluate some results from my tracker (YOLOv3 + SORT) on the MOT16 dataset. I am trying to use the following command:

python -m motmetrics.apps.evaluateTracking GT_ROOT TEST_ROOT seqmaps/seqmap.txt --fmt mot16,

where my directory structure is: GT_ROOT/MOT16-02/gt/gt.txt TEST_ROOT/MOT16-02.txt seqmaps/seqmap.txt

the content of seqmap.txt is just MOT16-02, as recommended when running python -m motmetrics.apps.evaluateTracking --help

Specifically, I am getting this error: raise KeyError(key) KeyError: 'Sequence', coming from motmetrics\preprocess.py", line 52, in preprocessResult F = int(seqIni['Sequence']['seqLength'])

Upon inspecting this further, it seems that the seqIni dictionary takes its keys (partly) from seqmap, so it seems that the string 'Sequence' must be in seqmap.txt.

If I add it, I get 10:32:33 ERROR - gt File GT_ROOT\Sequence\gt/gt.txt not found.

which makes sense, since seqmap.txt is supposed to contain just the sequence names for mapping purposes, so why does it expect to have 'Sequence'?

Thanks in advance

Blair129 commented 4 years ago

I'm facing this problem too. Is there any way to solve it? Thx

Blair129 commented 4 years ago

Well, I find out that you should also put the file "seqinfo.ini" in your directory and then it will work.

hyperparameters commented 4 years ago

@Blair129 what should seqinfo.ini contain ?

jvlmdr commented 4 years ago

Hi. I'm not very familiar with the evaluateTracking app, but here is an example of a seqinfo.ini file from the MOT17 test set (taken from https://motchallenge.net/data/MOT17Labels.zip)

[Sequence]
name=MOT17-14-SDP
imDir=img1
frameRate=25
seqLength=750
imWidth=1920
imHeight=1080
imExt=.jpg

It looks like preprocess.py only uses 'seqLength', so you might not need to provide all of these entries.

jvlmdr commented 4 years ago

Oops sorry, I didn't mean to close your issue.

hanshong commented 4 years ago

When I evaluated some results on MOT15 dataset, It happened KeyError:'Sequence' at first. And then I add seqinfo.ini files into the MOT15 dataset files. But it still had a error as follows:

Traceback (most recent call last): File "motmetrics/apps/evaluateTracking.py", line 185, in main() File "motmetrics/apps/evaluateTracking.py", line 174, in main accs, analysis, names = compare_dataframes(gt, ts, args.log, 1. - args.iou) File "motmetrics/apps/evaluateTracking.py", line 87, in compare_dataframes acc, ana = mm.utils.CLEAR_MOT_M(gts[k][0], tsacc, gts[k][1], 'iou', distth=iou, vflag=fd) File "/home/py-motmetrics/motmetrics/utils.py", line 127, in CLEAR_MOT_M dt = preprocessResult(dt, gt, inifile) File "/home/py-motmetrics/motmetrics/preprocess.py", line 66, in preprocessResult for i, (k, it) in enumerate(GTInFrame.iterrows()) File "/home/py-motmetrics/motmetrics/preprocess.py", line 66, in for i, (k, it) in enumerate(GTInFrame.iterrows()) KeyError: 4.4852

Is it due to the unfamiliar data format in gt.txt between MOT15 and MOT17? How could I modify it? Hope for response, thanks!!

cheind commented 4 years ago

@hanshong there seems to be a mismatch between the expected and given file format. Could you provide a MWE that reproduces the error?

cheind commented 4 years ago

Closing this due to lack of activity. Please reopen when you got an MWE.