Skip to content

Commit

Permalink
update processing
Browse files Browse the repository at this point in the history
  • Loading branch information
gferraro committed Apr 24, 2024
1 parent bc5d7eb commit c301a8c
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions processing/audio_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand Down Expand Up @@ -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"])
Expand Down

0 comments on commit c301a8c

Please sign in to comment.