Skip to content

Commit

Permalink
Lower default score filter to 0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
alankbi committed Feb 14, 2020
1 parent c651866 commit 8d9355e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions detecto/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from torchvision import transforms


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

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


def plot_prediction_grid(model, images, dim=None, figsize=None, score_filter=0.8):
def plot_prediction_grid(model, images, dim=None, figsize=None, score_filter=0.6):
"""Plots a grid of images with boxes drawn around predicted objects.
:param model: The trained model with which to run object detection.
Expand All @@ -126,7 +126,7 @@ def plot_prediction_grid(model, images, dim=None, figsize=None, score_filter=0.8
``(width, height)``. Defaults to None.
:type figsize: tuple or None
:param score_filter: (Optional) Minimum score required to show a
prediction. Defaults to 0.8.
prediction. Defaults to 0.6.
:type score_filter: float
**Example**::
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="detecto",
version="1.1.1",
version="1.1.2",
author="Alan Bi",
author_email="alan.bi326@gmail.com",
description="Build fully-functioning computer vision models with 5 lines of code",
Expand Down

0 comments on commit 8d9355e

Please sign in to comment.