Skip to content

Commit

Permalink
Merge pull request #1 from roboflow-ai/Min-Detections-Variable
Browse files Browse the repository at this point in the history
Add min detections a configurable variable
  • Loading branch information
Brad Dwyer authored Sep 12, 2022
2 parents b0a3ad4 + 2adfe6c commit 85f6d85
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/renderMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ const CONFIG = {
mapboxAccessToken: 'pk.eyJ1IjoieWVsZGFyYnkiLCJhIjoiY2w3czRlcG5qMGxvbDNxbnVoOTUzeW9nNCJ9.RKnzgCuuLaaFzcFsuZWdFQ',

// if detections are closer than this constant, combine them into a single marker
MIN_SEPARATION_OF_DETECTIONS_IN_METERS: 20
MIN_SEPARATION_OF_DETECTIONS_IN_METERS: 20,

// wait until a detection is made on this number of distinct frames before showing the marker
MIN_DETECTIONS_TO_MAKE_VISIBLE: 2
}

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

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

0 comments on commit 85f6d85

Please sign in to comment.