Skip to content

Commit

Permalink
Update utils.py (#580)
Browse files Browse the repository at this point in the history
  • Loading branch information
Josef-Haupt authored Feb 13, 2025
1 parent 3505250 commit b3f29a0
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions birdnet_analyzer/analyze/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,23 +167,22 @@ def generate_kaleidoscope(timestamps: list[str], result: dict[str, list], afile_
start, end = timestamp.split("-", 1)

for c in result[timestamp]:
if c[1] > cfg.MIN_CONFIDENCE and (not cfg.SPECIES_LIST or c[0] in cfg.SPECIES_LIST):
label = cfg.TRANSLATED_LABELS[cfg.LABELS.index(c[0])]
rstring += "{},{},{},{},{},{},{},{:.4f},{:.4f},{:.4f},{},{},{}\n".format(
parent_folder.rstrip("/"),
folder_name,
filename,
start,
float(end) - float(start),
label.split("_", 1)[0],
label.split("_", 1)[-1],
c[1],
cfg.LATITUDE,
cfg.LONGITUDE,
cfg.WEEK,
cfg.SIG_OVERLAP,
cfg.SIGMOID_SENSITIVITY,
)
label = cfg.TRANSLATED_LABELS[cfg.LABELS.index(c[0])]
rstring += "{},{},{},{},{},{},{},{:.4f},{:.4f},{:.4f},{},{},{}\n".format(
parent_folder.rstrip("/"),
folder_name,
filename,
start,
float(end) - float(start),
label.split("_", 1)[0],
label.split("_", 1)[-1],
c[1],
cfg.LATITUDE,
cfg.LONGITUDE,
cfg.WEEK,
cfg.SIG_OVERLAP,
cfg.SIGMOID_SENSITIVITY,
)

# Write result string to file
out_string += rstring
Expand Down

0 comments on commit b3f29a0

Please sign in to comment.