Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on all empty hypotheses in accumulator #49

Closed
jirip opened this issue Aug 15, 2019 · 2 comments
Closed

Crash on all empty hypotheses in accumulator #49

jirip opened this issue Aug 15, 2019 · 2 comments

Comments

@jirip
Copy link

jirip commented Aug 15, 2019

Hello, this is somehow edge case (maybe similar to #23). I run motmetrics evaluation on a set of experiments and it happens that there are no hypotheses at all. Something like this:

acc = motmetrics.MOTAccumulator(auto_id=True)
acc.update([2], [], numpy.empty((0, 0)))
acc.update([2, 3], [], numpy.empty((0, 0)))
acc.update([3], [], numpy.empty((0, 0)))

metrics = motmetrics.metrics.create()
summary = metrics.compute(acc)

That will cause a crash on motmetrics.py:L377:

IndexError: cannot do a non-empty take from an empty axes.

I'd expect to get results like:
frames: 3 , mostly_lost: 2, num_misses: 4, mota: 0, motp: nan, ...

@Borda
Copy link
Contributor

Borda commented Aug 15, 2019

@cheind @christosavg what id the expected behaviour in such a case?

jvlmdr pushed a commit to jvlmdr/py-motmetrics that referenced this issue Nov 15, 2019
cheind pushed a commit that referenced this issue Nov 15, 2019
* version bump

* fix realease readme

* Add test for empty predictions

Reproduces issue: #49

* Add support for empty predictions.

Select non-empty elements before making hypothesis ID an index.
This avoids "non-empty take from an empty axes" error.

* Pass list to loc[] to ensure DataFrame is returned

DataFrame.loc[] may return DataFrame or Series.

* Add both-empty test. Re-factor tests.

* Fix event dataframe creator for zero events

Add corresponding test.
cheind pushed a commit that referenced this issue Nov 16, 2019
* version bump

* fix realease readme

* Add test for empty predictions

Reproduces issue: #49

* Add support for empty predictions.

Select non-empty elements before making hypothesis ID an index.
This avoids "non-empty take from an empty axes" error.

* Pass list to loc[] to ensure DataFrame is returned

DataFrame.loc[] may return DataFrame or Series.

* Add both-empty test. Re-factor tests.

* Fix event dataframe creator for zero events

Add corresponding test.

* Add _qdiv to produce nans silently

* Use warnings.catch_warnings for suppression
jvlmdr pushed a commit to jvlmdr/py-motmetrics that referenced this issue Nov 30, 2019
cheind pushed a commit that referenced this issue Dec 2, 2019
* version bump

* fix realease readme

* Add test for empty predictions

Reproduces issue: #49

* Add support for empty predictions.

Select non-empty elements before making hypothesis ID an index.
This avoids "non-empty take from an empty axes" error.

* Pass list to loc[] to ensure DataFrame is returned

DataFrame.loc[] may return DataFrame or Series.

* Add both-empty test. Re-factor tests.

* Fix event dataframe creator for zero events

Add corresponding test.

* Add _qdiv to produce nans silently

* Use warnings.catch_warnings for suppression

* Use single groupby() call to count events

Speeds up construction of linear assignment problem.

* Fix mistake in row and column indexing

* Separate counts from computing metrics

Add benchmark using pytest-benchmark.

* Remove commented-out lines
@cheind
Copy link
Owner

cheind commented Jan 18, 2020

That should be fixed on develop. Closing this. Reopen if necessary.

@cheind cheind closed this as completed Jan 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants