Skip to content

Commit

Permalink
Always use euclidean distance in camera_motion demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Agustín Castro committed Feb 23, 2024
1 parent 009a1b1 commit 6ff1a4e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions demos/camera_motion/src/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,20 +224,18 @@ def run():
else partial(video.show, downsample_ratio=args.downsample_ratio)
)

distance_threshold = args.distance_threshold
if args.distance_threshold is None:
distance_threshold = video.input_height / 10
else:
distance_threshold = args.distance_threshold

if args.track_boxes:
drawing_function = draw_boxes
distance_function = "iou"
if args.distance_threshold is None:
distance_threshold = 0.5
else:
drawing_function = draw_points
distance_function = "euclidean"
if args.distance_threshold is None:
distance_threshold = video.input_height / 10

tracker = Tracker(
distance_function=distance_function,
distance_function="euclidean",
detection_threshold=args.confidence_threshold,
distance_threshold=distance_threshold,
initialization_delay=args.initialization_delay,
Expand Down Expand Up @@ -279,6 +277,7 @@ def run():
text_thickness=None
if args.id_size is None
else int(args.id_size * 2),
draw_ids=True,
)

if args.absolute_grid:
Expand Down

0 comments on commit 6ff1a4e

Please sign in to comment.