You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
detect-content / detect-adaptive -k with an invalid kernel size crashes with a traceback; config accepts kernel-size = 1 #604
Passing -k/--kernel-size with a value the detector does not accept (1, an even number, a negative number) makes the CLI exit with a Python traceback instead of a usage error. The same happens with kernel-size = 1 in a config file: the config validator accepts 1, although its own docstring and error message say the value must be greater than 1, and the detector requires an odd integer >= 3. Other options of the same commands (--weights, --downscale) already report a bad value as a usage error.
Command
scenedetect -i tests/resources/testvideo.mp4 detect-content -k 1 time -e 2s
scenedetect -c k1.cfg -i tests/resources/testvideo.mp4 detect-content time -e 2s
Traceback (most recent call last):
...
File "...\scenedetect\detectors\content_detector.py", line 138, in __init__
raise ValueError("kernel_size must be odd integer >= 3")
ValueError: kernel_size must be odd integer >= 3
Environment
PySceneDetect 0.8-dev0 (main @ c0d4870)
OS Windows-11-10.0.26200-SP0
Python CPython 3.12.16
av 19.0.2
click 8.5.1
opencv-python 5.0.0.93
numpy 2.5.4
Media/Files
tests/resources/testvideo.mp4 from the resources branch.
I have a small fix with tests ready and will open a PR referencing this issue.
AI disclosure: found and reproduced with Claude Code (Claude Opus 5.5), reviewed by me.
Activity
[bugfix] Reuse KernelSizeValue for -k so -1 means auto (Breakthrough#604
[bugfix] Reject invalid --kernel-size with a usage error instead of a…