From c301a8c4cfaa07ffff81e906c80163564654cc6e Mon Sep 17 00:00:00 2001 From: gferraro Date: Wed, 24 Apr 2024 13:45:41 +1200 Subject: [PATCH] update processing --- processing/audio_analysis.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/processing/audio_analysis.py b/processing/audio_analysis.py index 6f93eba..d4bdd44 100644 --- a/processing/audio_analysis.py +++ b/processing/audio_analysis.py @@ -69,13 +69,13 @@ def track_analyse(recording, jwtKey, conf): logger.debug("downloading recording to %s", input_filename) api.download_file(jwtKey, str(input_filename)) - + track_info = api.get_track_info(recording["id"]).get("tracks") + track_info = [ t for t in track_info if not any(tag for tag in t["tags"] if tag["automatic"])] + recording["Tracks"] = track_info filename = input_filename.with_suffix(".txt") with filename.open("w") as f: json.dump(recording, f) - test_file = Path("./test.json") - with test_file.open("w") as f: - json.dump(recording, f) + analysis = analyse(input_filename, conf,analyse_tracks=True) if analysis["species_identify"]: @@ -105,11 +105,6 @@ def track_analyse(recording, jwtKey, conf): api.add_track_tag(recording, analysis_result["track_id"], prediction, data) data["name"] = prediction["model"] api.add_track_tag(recording, analysis_result["track_id"], prediction, data) - for t in recording["Tracks"]: - if t["id"]== analysis_result["track_id"]: - t["classify"]= False - api.classified_track(recording, t) - break api.report_done(recording, metadata=new_metadata) logger.info("Completed classifying for file: %s", recording["id"])