Add end-of-clips dialog and --no-skip flag

Show a modal dialog when all clips have been processed and quit cleanly.
Add --no-skip CLI flag to include already-annotated clips (default remains to skip them).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-20 14:08:47 +02:00
parent b4daa28354
commit 4aa1e32681
4 changed files with 36 additions and 5 deletions

View File

@@ -6,11 +6,13 @@ import numpy as np
from PIL import Image
from PySide6.QtCore import QTimer
from PySide6.QtWidgets import (
QApplication,
QButtonGroup,
QGroupBox,
QHBoxLayout,
QLabel,
QMainWindow,
QMessageBox,
QPushButton,
QRadioButton,
QVBoxLayout,
@@ -29,6 +31,7 @@ class Annotator(QMainWindow):
config: AppConfig,
clip: str = None,
extras: bool = False,
skip_annotated: bool = True,
):
super().__init__()
@@ -42,6 +45,7 @@ class Annotator(QMainWindow):
clips_file=Path(config.clips_file),
mask_filename=config.filenames.mask,
zip_extension=config.filenames.zip_extension,
skip_annotated=skip_annotated,
)
self.setWindowTitle("River Annotator")
@@ -251,7 +255,16 @@ class Annotator(QMainWindow):
self._set_answers(answers)
def _advance_clip(self):
self._load_clip()
try:
self._load_clip()
except RuntimeError:
msg = QMessageBox(self)
msg.setWindowTitle("All done!")
msg.setText("You have reached the end of all clips.")
msg.setStandardButtons(QMessageBox.StandardButton.Ok)
msg.exec()
QApplication.instance().quit()
return
self.frame_i = 0
self.mc.load_clip(
self.frames,