Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmark/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import argparse
import time
import os
import time

from tqdm import tqdm

Expand Down
4 changes: 4 additions & 0 deletions scenedetect/detectors/hash_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,7 @@ def hash_frame(frame_img, hash_size, factor) -> numpy.ndarray:
hash_img = dct_low_freq > med

return hash_img

@property
def downscale_performance_hint(self) -> bool:
return False
5 changes: 5 additions & 0 deletions scenedetect/scene_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ def event_buffer_length(self) -> int:
"""
return 0

@property
def downscale_performance_hint(self) -> bool:
"""Indicates if the detector's performance is improved by downscaling."""
return True


# TODO(v0.7): Remove this early, no point in keeping it around.
class SparseSceneDetector(SceneDetector):
Expand Down
4 changes: 3 additions & 1 deletion scenedetect/scene_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,9 @@ def detect_scenes(
1 + min(max_y, frame_height) - min_y,
)
# Calculate downscale factor and log effective resolution.
if self.auto_downscale:
if self.auto_downscale and all(
detector.downscale_performance_hint for detector in self._detector_list
):
downscale_factor = compute_downscale_factor(max(effective_frame_size))
else:
downscale_factor = self.downscale
Expand Down
Loading