Skip to content

Commit

Permalink
fix: do not print dog bark detections if dog bark filter is not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
tphakala committed Jun 1, 2024
1 parent 264fd4f commit 6a899eb
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions internal/analysis/processor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,19 +185,18 @@ func (p *Processor) processResults(item *queue.Results) []Detections {
speciesLowercase := strings.ToLower(commonName)

// Dog detection handling
if strings.Contains(speciesLowercase, "dog") && result.Confidence > p.Settings.Realtime.DogBarkFilter.Confidence {
log.Printf("Dog detected, updating last detection timestamp for potential owl false positives")
p.LastDogDetection = time.Now()
if p.Settings.Realtime.DogBarkFilter.Enabled {
if strings.Contains(speciesLowercase, "dog") && result.Confidence > p.Settings.Realtime.DogBarkFilter.Confidence {
log.Printf("Dog detected, updating last detection timestamp for potential owl false positives")
p.LastDogDetection = time.Now()
}
}

// Human detection handling for privacy filter
if p.Settings.Realtime.PrivacyFilter.Enabled {
// if debug is enabled print results
if p.Settings.Realtime.PrivacyFilter.Debug {
log.Printf("[Privacy filter] species: %s, confidence: %.2f\n", speciesLowercase, result.Confidence)
}
if strings.Contains(speciesLowercase, "human") && result.Confidence > p.Settings.Realtime.PrivacyFilter.Confidence {
log.Printf("Human detected, updating last detection timestamp for privacy filtering")
log.Printf("Human detected, confidence %s", result.Confidence)

Check failure on line 199 in internal/analysis/processor/processor.go

View workflow job for this annotation

GitHub Actions / unit-tests

log.Printf format %s has arg result.Confidence of wrong type float32
// now minus 4 seconds
p.LastHumanDetection = time.Now().Add(-4 * time.Second)
}
Expand Down

0 comments on commit 6a899eb

Please sign in to comment.