Skip to content

Highscore doesn't get reset when thumbnails are off #267

@wemily

Description

@wemily

With --verbosity debug but thumbnails off, the scores saved to the log are always monotonically increasing, like this:

% grep "high" log.txt
DEBUG: dvr_scan scanner.scan(): event 1 high score 1.861192
DEBUG: dvr_scan scanner.scan(): event 2 high score 47.147015
DEBUG: dvr_scan scanner.scan(): event 3 high score 58.441677
DEBUG: dvr_scan scanner.scan(): event 4 high score 58.441677
DEBUG: dvr_scan scanner.scan(): event 5 high score 108.115569
DEBUG: dvr_scan scanner.scan(): event 6 high score 108.115569
DEBUG: dvr_scan scanner.scan(): event 7 high score 108.115569
DEBUG: dvr_scan scanner.scan(): event 8 high score 108.115569
DEBUG: dvr_scan scanner.scan(): event 9 high score 244.567937
DEBUG: dvr_scan scanner.scan(): event 10 high score 244.567937
DEBUG: dvr_scan scanner.scan(): event 11 high score 244.567937
DEBUG: dvr_scan scanner.scan(): event 12 high score 244.567937
[...]
DEBUG: dvr_scan scanner.scan(): event 331 high score 244.567937

It looks like this is because the score doesn't get reset to zero unless thumbnails are on.

if self._thumbnails == "highscore":
video_name = self._input.paths[0].stem
output_path: Path = (
self._comp_file
if self._comp_file
else Path(
OUTPUT_FILE_TEMPLATE.format(
VIDEO_NAME=video_name,
EVENT_NUMBER="%04d" % (1 + self._num_events),
EXTENSION="jpg",
)
)
)
if self._output_dir:
output_path = self._output_dir / output_path
cv2.imwrite(str(output_path), self._highframe)
self._highscore = 0
self._highframe = None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions