Skip to content

Commit 8d9355e

Browse files
committed
Lower default score filter to 0.6
1 parent c651866 commit 8d9355e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

detecto/visualize.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from torchvision import transforms
88

99

10-
def detect_video(model, input_file, output_file, fps=30, score_filter=0.8):
10+
def detect_video(model, input_file, output_file, fps=30, score_filter=0.6):
1111
"""Takes in a video and produces an output video with object detection
1212
run on it (i.e. displays boxes around detected objects in real-time).
1313
Output videos should have the .avi file extension. Note: some apps,
@@ -27,7 +27,7 @@ def detect_video(model, input_file, output_file, fps=30, score_filter=0.8):
2727
Defaults to 30.
2828
:type fps: int
2929
:param score_filter: (Optional) Minimum score required to show a
30-
prediction. Defaults to 0.8.
30+
prediction. Defaults to 0.6.
3131
:type score_filter: float
3232
3333
**Example**::
@@ -36,7 +36,7 @@ def detect_video(model, input_file, output_file, fps=30, score_filter=0.8):
3636
>>> from detecto.visualize import detect_video
3737
3838
>>> model = Model.load('model_weights.pth', ['tick', 'gate'])
39-
>>> detect_video(model, 'input_vid.mp4', 'output_vid.avi', score_filter=0.6)
39+
>>> detect_video(model, 'input_vid.mp4', 'output_vid.avi', score_filter=0.7)
4040
"""
4141

4242
# Read in the video
@@ -108,7 +108,7 @@ def detect_video(model, input_file, output_file, fps=30, score_filter=0.8):
108108
cv2.destroyAllWindows()
109109

110110

111-
def plot_prediction_grid(model, images, dim=None, figsize=None, score_filter=0.8):
111+
def plot_prediction_grid(model, images, dim=None, figsize=None, score_filter=0.6):
112112
"""Plots a grid of images with boxes drawn around predicted objects.
113113
114114
:param model: The trained model with which to run object detection.
@@ -126,7 +126,7 @@ def plot_prediction_grid(model, images, dim=None, figsize=None, score_filter=0.8
126126
``(width, height)``. Defaults to None.
127127
:type figsize: tuple or None
128128
:param score_filter: (Optional) Minimum score required to show a
129-
prediction. Defaults to 0.8.
129+
prediction. Defaults to 0.6.
130130
:type score_filter: float
131131
132132
**Example**::

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="detecto",
8-
version="1.1.1",
8+
version="1.1.2",
99
author="Alan Bi",
1010
author_email="[email protected]",
1111
description="Build fully-functioning computer vision models with 5 lines of code",

0 commit comments

Comments
 (0)