Skip to content

Commit 85f6d85

Browse files
author
Brad Dwyer
authored
Merge pull request #1 from roboflow-ai/Min-Detections-Variable
Add min detections a configurable variable
2 parents b0a3ad4 + 2adfe6c commit 85f6d85

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/renderMap.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ const CONFIG = {
44
mapboxAccessToken: 'pk.eyJ1IjoieWVsZGFyYnkiLCJhIjoiY2w3czRlcG5qMGxvbDNxbnVoOTUzeW9nNCJ9.RKnzgCuuLaaFzcFsuZWdFQ',
55

66
// if detections are closer than this constant, combine them into a single marker
7-
MIN_SEPARATION_OF_DETECTIONS_IN_METERS: 20
7+
MIN_SEPARATION_OF_DETECTIONS_IN_METERS: 20,
8+
9+
// wait until a detection is made on this number of distinct frames before showing the marker
10+
MIN_DETECTIONS_TO_MAKE_VISIBLE: 2
811
}
912

1013
// Dependency for map rendering
@@ -230,7 +233,7 @@ var renderMap = async function(videoFile, flightLogFile) {
230233

231234
// only show a panel if it has been detected at least twice
232235
// (this prevents noisy predictions from clogging up the map)
233-
if(!p.marker && p.points.length >= 2) {
236+
if(!p.marker && p.points.length >= CONFIG.MIN_DETECTIONS_TO_MAKE_VISIBLE) {
234237
var marker = new mapboxgl.Marker()
235238
.setLngLat(location)
236239
.addTo(map);

0 commit comments

Comments
 (0)