Skip to content

Commit 346a817

Browse files
committed
[docs] Ensure detectors have individual headers, general ledgibility improvements
1 parent aae0e67 commit 346a817

6 files changed

Lines changed: 50 additions & 40 deletions

File tree

docs/api.rst

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -96,23 +96,6 @@ Functions
9696
.. automodule:: scenedetect
9797
:members:
9898

99-
.. toctree::
100-
:maxdepth: 3
101-
:caption: PySceneDetect Module Documentation
102-
:name: fullapitoc
103-
:hidden:
104-
105-
api/migration_guide
106-
api/detectors
107-
api/scene_manager
108-
api/common
109-
api/output
110-
api/backends
111-
api/stats_manager
112-
api/detector
113-
api/video_stream
114-
api/platform
115-
11699

117100
=======================================================================
118101
Logging

docs/api/detectors.rst

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,48 @@ Detectors
66
----------------------------------------
77

88
.. automodule:: scenedetect.detectors
9-
:members:
9+
10+
AdaptiveDetector
11+
========================================
1012

1113
.. automodule:: scenedetect.detectors.adaptive_detector
14+
:no-members:
15+
16+
.. autoclass:: scenedetect.detectors.adaptive_detector.AdaptiveDetector
1217
:members:
1318

19+
ContentDetector
20+
========================================
21+
1422
.. automodule:: scenedetect.detectors.content_detector
23+
:no-members:
24+
25+
.. autoclass:: scenedetect.detectors.content_detector.ContentDetector
1526
:members:
1627

28+
HashDetector
29+
========================================
30+
1731
.. automodule:: scenedetect.detectors.hash_detector
32+
:no-members:
33+
34+
.. autoclass:: scenedetect.detectors.hash_detector.HashDetector
1835
:members:
1936

37+
HistogramDetector
38+
========================================
39+
2040
.. automodule:: scenedetect.detectors.histogram_detector
41+
:no-members:
42+
43+
.. autoclass:: scenedetect.detectors.histogram_detector.HistogramDetector
2144
:members:
2245

46+
ThresholdDetector
47+
========================================
48+
2349
.. automodule:: scenedetect.detectors.threshold_detector
50+
:no-members:
51+
52+
.. autoclass:: scenedetect.detectors.threshold_detector.ThresholdDetector
2453
:members:

docs/api/migration_guide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.. _scenedetect-migration-guide:
33

44
***********************************************************************
5-
Migration Guide: v0.6 to v0.7
5+
Migration Guide (v0.7)
66
***********************************************************************
77

88
PySceneDetect v0.7 is a major release that overhauls timestamp handling to support variable framerate (VFR) videos. While the high-level :func:`scenedetect.detect` workflow is largely unchanged, several internal APIs have been restructured. This guide covers the changes needed to update applications from v0.6 to v0.7.

docs/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
autodoc_typehints = "description"
4646
autodoc_typehints_format = "short"
4747

48+
add_module_names = False
49+
python_use_unqualified_type_names = True
50+
4851
# Add any paths that contain templates here, relative to this directory.
4952
templates_path = ["_templates"]
5053

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Table of Contents
5454
api/video_stream
5555
api/stats_manager
5656
api/platform
57+
api/migration_guide
5758

5859
=======================================================================
5960
Indices and Tables

scenedetect/detectors/histogram_detector.py

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -132,29 +132,23 @@ def calculate_histogram(
132132
across all bins.
133133
134134
Args:
135-
-----
136-
frame_img : np.ndarray
137-
The input image in BGR color space, assumed to have shape (height, width, 3)
138-
where the last dimension represents the BGR channels.
139-
bins : int, optional (default=256)
140-
The number of bins to use for the histogram.
141-
normalize : bool, optional (default=True)
142-
A boolean flag that determines whether the histogram should be normalized
143-
such that the sum of all histogram bins equals 1.
135+
frame_img: The input image in BGR color space, assumed to have shape
136+
(height, width, 3) where the last dimension represents the BGR channels.
137+
bins: The number of bins to use for the histogram.
138+
normalize: A boolean flag that determines whether the histogram should be
139+
normalized such that the sum of all histogram bins equals 1.
144140
145141
Returns:
146-
--------
147-
np.ndarray
148-
A 1D numpy array of length equal to `bins`, representing the histogram of the luma
149-
channel. Each element in the array represents the count (or frequency) of a particular
150-
luma value in the image. If normalized, these values represent the relative frequency.
151-
152-
Examples:
153-
---------
154-
>>> img = cv2.imread("path_to_image.jpg")
155-
>>> hist = calculate_histogram(img, bins=256, normalize=True)
156-
>>> print(hist.shape)
157-
(256,)
142+
A 1D numpy array of length equal to `bins`, representing the histogram of the
143+
luma channel. Each element in the array represents the count (or frequency) of
144+
a particular luma value in the image. If normalized, these values represent the
145+
relative frequency.
146+
147+
Example:
148+
>>> img = cv2.imread("path_to_image.jpg")
149+
>>> hist = calculate_histogram(img, bins=256, normalize=True)
150+
>>> print(hist.shape)
151+
(256,)
158152
"""
159153
# Extract Luma channel from the frame image
160154
y, _, _ = cv2.split(cv2.cvtColor(frame_img, cv2.COLOR_BGR2YUV))

0 commit comments

Comments
 (0)