Address PR review comments: rename to __main__.py, improve config examples, document save freeze

This commit is contained in:
2026-06-02 11:51:37 +02:00
parent 69eab7514f
commit dc7bb8e7eb
4 changed files with 29 additions and 19 deletions

View File

@@ -24,7 +24,7 @@ cp config/clips.example.txt config/clips.txt
# Edit config/questions.yaml to customise survey questions (optional)
# 4. Run
uv run python -m clip_annotator.annotation_script
uv run python -m clip_annotator
```
## Installation
@@ -81,9 +81,9 @@ The `clips_file` (the list of clip filenames to annotate) is always read from th
## Usage
```sh
uv run python -m clip_annotator.annotation_script
uv run python -m clip_annotator
# or, if you have the venv activated:
python -m clip_annotator.annotation_script
python -m clip_annotator
```
### Arguments
@@ -95,23 +95,23 @@ python -m clip_annotator.annotation_script
| `--out` | *(from config)* | Override `out_dir` from config |
| `--clips` | *(from config)* | Override `clips_file` from config |
| `--clip` | *(first unannotated in list)* | Open a specific clip by its stem name (filename without extension, e.g. `clip_20230501T120000`) |
| `--extras` | off | Also save GIFs and extra PNGs (see Output section) |
| `--extras` | off | Also save GIFs and extra PNGs (see Output section). **Note: GIF encoding is slow — saving will freeze the UI for several seconds per clip.** |
| `--no-skip` | off | Show already-annotated clips instead of skipping them |
### Typical workflows
```sh
# Annotate clips listed in config/clips.txt (default)
uv run python -m clip_annotator.annotation_script
uv run python -m clip_annotator
# Use a different config file
uv run python -m clip_annotator.annotation_script --config config/my_config.yaml
uv run python -m clip_annotator --config config/my_config.yaml
# Override paths from the command line
uv run python -m clip_annotator.annotation_script --data data/clips --out data/out
uv run python -m clip_annotator --data data/clips --out data/out
# Annotate a single specific clip
uv run python -m clip_annotator.annotation_script --clip clip_20230615T120000
uv run python -m clip_annotator --clip clip_20230615T120000
```
## Configuration
@@ -179,7 +179,7 @@ Copy `config/clips.example.txt` as a starting point.
To distribute clips across multiple annotators, create one clips file per annotator (e.g. `config/annotator_A.txt`) listing their assigned clip filenames, then pass it via `--clips`:
```sh
uv run python -m clip_annotator.annotation_script --clips config/annotator_A.txt
uv run python -m clip_annotator --clips config/annotator_A.txt
```
Assigning non-overlapping clip lists lets each annotator work independently. Intentionally overlapping a subset of clips across annotators enables inter-annotator agreement checks.
@@ -263,7 +263,7 @@ Click **↺** below any slider to restore its default value.
| Action | How |
|---|---|
| Save and continue | **Next** — saves current clip and loads the next one. If the clip already has a saved annotation a dialog asks whether to replace it or keep the existing save. |
| Save and continue | **Next** — saves current clip and loads the next one. If the clip already has a saved annotation a dialog asks whether to replace it or keep the existing save. The UI freezes during saving; this is normal — wait for it to complete before clicking again. |
| Go back | **Previous** — saves current clip and returns to the previously viewed clip. Disabled on the first clip. |
| Skip without saving | **Skip** — discards any unsaved changes and loads the next clip without writing anything to disk. |
@@ -335,7 +335,7 @@ config/
questions.yaml # Survey question definitions
optical_flow_config.yaml # Optical flow parameters (set enabled: false to disable Auto Segment)
src/clip_annotator/
annotation_script.py # Entry point — argument parsing and app launch
__main__.py # Entry point — argument parsing and app launch
annotator.py # Main QMainWindow — orchestrates all components
clip_selector.py # Reads the clip list and picks the next clip
filesystem.py # Storage backend — local passthrough or S3 via s3fs