Skip to content

Commit 1292cac

Browse files
committed
[adaptive_detector] Remove deprecated min_delta_hsv argument
1 parent 34dffab commit 1292cac

File tree

6 files changed

+1
-40
lines changed

6 files changed

+1
-40
lines changed

docs/cli.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,7 @@ Options
178178

179179
Default: ``15.0``
180180

181-
.. option:: -d VAL, --min-delta-hsv VAL
182181

183-
[DEPRECATED] Use :option:`-c/--min-content-val <-c>` instead.
184-
185-
Default: ``15.0``
186182

187183
.. option:: -f VAL, --frame-window VAL
188184

scenedetect/_cli/__init__.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -615,16 +615,6 @@ def detect_content_command(
615615
help='Minimum threshold (float) that "content_val" must exceed to trigger a cut.%s'
616616
% (USER_CONFIG.get_help_string("detect-adaptive", "min-content-val")),
617617
)
618-
@click.option(
619-
"--min-delta-hsv",
620-
"-d",
621-
metavar="VAL",
622-
type=click.FLOAT,
623-
default=None,
624-
help="[DEPRECATED] Use -c/--min-content-val instead.%s"
625-
% (USER_CONFIG.get_help_string("detect-adaptive", "min-delta-hsv")),
626-
hidden=True,
627-
)
628618
@click.option(
629619
"--frame-window",
630620
"-f",
@@ -677,7 +667,6 @@ def detect_adaptive_command(
677667
ctx: click.Context,
678668
threshold: ty.Optional[float],
679669
min_content_val: ty.Optional[float],
680-
min_delta_hsv: ty.Optional[float],
681670
frame_window: ty.Optional[int],
682671
weights: ty.Optional[ty.Tuple[float, float, float, float]],
683672
luma_only: bool,
@@ -689,7 +678,6 @@ def detect_adaptive_command(
689678
detector_args = ctx.get_detect_adaptive_params(
690679
threshold=threshold,
691680
min_content_val=min_content_val,
692-
min_delta_hsv=min_delta_hsv,
693681
frame_window=frame_window,
694682
luma_only=luma_only,
695683
min_scene_len=min_scene_len,

scenedetect/_cli/config.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,6 @@ class XmlFormat(Enum):
325325
DEFAULT_JPG_QUALITY = 95
326326
DEFAULT_WEBP_QUALITY = 100
327327

328-
# TODO(v0.7): Remove [detect-adaptive] min-delta-hsv
329328
CONFIG_MAP: ConfigDict = {
330329
"backend-opencv": {
331330
"max-decode-attempts": 5,
@@ -339,7 +338,6 @@ class XmlFormat(Enum):
339338
"kernel-size": KernelSizeValue(-1),
340339
"luma-only": False,
341340
"min-content-val": RangeValue(15.0, min_val=0.0, max_val=255.0),
342-
"min-delta-hsv": RangeValue(15.0, min_val=0.0, max_val=255.0),
343341
"min-scene-len": TimecodeValue(0),
344342
"threshold": RangeValue(3.0, min_val=0.0, max_val=255.0),
345343
"weights": ScoreWeightsValue(ContentDetector.DEFAULT_COMPONENT_WEIGHTS),

scenedetect/_cli/context.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -357,26 +357,9 @@ def get_detect_adaptive_params(
357357
min_scene_len: ty.Optional[str] = None,
358358
weights: ty.Optional[ty.Tuple[float, float, float, float]] = None,
359359
kernel_size: ty.Optional[int] = None,
360-
min_delta_hsv: ty.Optional[float] = None,
361360
) -> ty.Dict[str, ty.Any]:
362361
"""Handle detect-adaptive command options and return args to construct one with."""
363362

364-
# TODO(v0.7): Remove these branches when removing -d/--min-delta-hsv.
365-
if min_delta_hsv is not None:
366-
logger.error("-d/--min-delta-hsv is deprecated, use -c/--min-content-val instead.")
367-
if min_content_val is None:
368-
min_content_val = min_delta_hsv
369-
# Handle case where deprecated min-delta-hsv is set, and use it to set min-content-val.
370-
if not self.config.is_default("detect-adaptive", "min-delta-hsv"):
371-
logger.error(
372-
"[detect-adaptive] config file option `min-delta-hsv` is deprecated"
373-
", use `min-delta-hsv` instead."
374-
)
375-
if self.config.is_default("detect-adaptive", "min-content-val"):
376-
self.config.config_dict["detect-adaptive"]["min-content-val"] = (
377-
self.config.config_dict["detect-adaptive"]["min-deleta-hsv"]
378-
)
379-
380363
if self.drop_short_scenes:
381364
min_scene_len = 0
382365
else:

scenedetect/detectors/adaptive_detector.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ def __init__(
4444
weights: ContentDetector.Components = ContentDetector.DEFAULT_COMPONENT_WEIGHTS,
4545
luma_only: bool = False,
4646
kernel_size: ty.Optional[int] = None,
47-
min_delta_hsv: ty.Optional[float] = None,
4847
):
4948
"""
5049
Arguments:
@@ -65,11 +64,7 @@ def __init__(
6564
Overrides `weights` if both are set.
6665
kernel_size: Size of kernel to use for post edge detection filtering. If None,
6766
automatically set based on video resolution.
68-
min_delta_hsv: [DEPRECATED] DO NOT USE. Use `min_content_val` instead.
6967
"""
70-
if min_delta_hsv is not None:
71-
logger.error("min_delta_hsv is deprecated, use min_content_val instead.")
72-
min_content_val = min_delta_hsv
7368
if window_width < 1:
7469
raise ValueError("window_width must be at least 1.")
7570

website/pages/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,7 @@ Although there have been minimal changes to most API examples, there are several
658658

659659
### CLI Changes
660660

661+
- [refactor] Remove deprecated `-d`/`--min-delta-hsv` option from `detect-adaptive` command.
661662
- [feature] WORK IN PROGRESS: New `save-xml` command supports saving scenes in Final Cut Pro format [#156](https://github.com/Breakthrough/PySceneDetect/issues/156)
662663

663664

0 commit comments

Comments
 (0)