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

Throw an error on unknown frames #1728

Merged
merged 1 commit into from
Jun 17, 2020
Merged

Throw an error on unknown frames #1728

merged 1 commit into from
Jun 17, 2020

Conversation

zhiltsov-max
Copy link
Contributor

Motivation and context

Follow up for #1615

Added an exception when frames have invalid ids instead of silently skipping annotations on import.

How has this been tested?

Unit tests

Checklist

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below)
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT

@coveralls
Copy link

Pull Request Test Coverage Report for Build 5821

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.01%) to 65.783%

Files with Coverage Reduction New Missed Lines %
cvat/apps/engine/media_extractors.py 5 76.18%
Totals Coverage Status
Change from base Build 5815: 0.01%
Covered Lines: 10951
Relevant Lines: 16245

💛 - Coveralls

return (absolute_id - self._db_task.data.start_frame) // self._frame_step
d, m = divmod(
absolute_id - self._db_task.data.start_frame, self._frame_step)
if m or d not in range(0, self._db_task.data.size):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can m or not(0 <= d < self._db_task.data.size) condition be used here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can, but I'm not a big fan of it. We also could write abs_id in range(start_frame, stop_frame, frame_step).

@azhavoro azhavoro merged commit 0e00315 into develop Jun 17, 2020
@azhavoro azhavoro deleted the zm/fail-on-unknown-anns branch June 17, 2020 14:13
frndmg pushed a commit to signatrix/cvat that referenced this pull request Aug 5, 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

Successfully merging this pull request may close these issues.

3 participants