7
7
from torchvision import transforms
8
8
9
9
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 ):
11
11
"""Takes in a video and produces an output video with object detection
12
12
run on it (i.e. displays boxes around detected objects in real-time).
13
13
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):
27
27
Defaults to 30.
28
28
:type fps: int
29
29
:param score_filter: (Optional) Minimum score required to show a
30
- prediction. Defaults to 0.8 .
30
+ prediction. Defaults to 0.6 .
31
31
:type score_filter: float
32
32
33
33
**Example**::
@@ -36,7 +36,7 @@ def detect_video(model, input_file, output_file, fps=30, score_filter=0.8):
36
36
>>> from detecto.visualize import detect_video
37
37
38
38
>>> 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 )
40
40
"""
41
41
42
42
# Read in the video
@@ -108,7 +108,7 @@ def detect_video(model, input_file, output_file, fps=30, score_filter=0.8):
108
108
cv2 .destroyAllWindows ()
109
109
110
110
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 ):
112
112
"""Plots a grid of images with boxes drawn around predicted objects.
113
113
114
114
: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
126
126
``(width, height)``. Defaults to None.
127
127
:type figsize: tuple or None
128
128
:param score_filter: (Optional) Minimum score required to show a
129
- prediction. Defaults to 0.8 .
129
+ prediction. Defaults to 0.6 .
130
130
:type score_filter: float
131
131
132
132
**Example**::
0 commit comments