From 6592f0cfc65e0799d69f97040bed82d5a389a18e Mon Sep 17 00:00:00 2001 From: Andrew Beveridge Date: Tue, 17 Dec 2024 23:26:03 -0500 Subject: [PATCH] Updated scores json with all stem names --- audio_separator/models-scores.json | 48 +++++++++++++------------- tests/model-metrics/test-all-models.py | 32 +++++++++++++++-- 2 files changed, 53 insertions(+), 27 deletions(-) diff --git a/audio_separator/models-scores.json b/audio_separator/models-scores.json index ec73c57..488fb89 100644 --- a/audio_separator/models-scores.json +++ b/audio_separator/models-scores.json @@ -21276,33 +21276,13 @@ ], "target_stem": "instrumental" }, - "Reverb_HQ_By_FoxJoy.onnx": { - "model_name": "MDX-Net Model: Reverb HQ By FoxJoy", - "track_scores": [], - "median_scores": {}, - "stems": [ - "reverb", - "no reverb" - ], - "target_stem": "reverb" - }, - "UVR-MDX-NET_Crowd_HQ_1.onnx": { - "model_name": "MDX-Net Model: UVR-MDX-NET Crowd HQ 1 By Aufr33", - "track_scores": [], - "median_scores": {}, - "stems": [ - "no crowd", - "no no crowd" - ], - "target_stem": "no crowd" - }, "17_HP-Wind_Inst-UVR.pth": { "model_name": "VR Arch Single Model v5: 17_HP-Wind_Inst-UVR", "track_scores": [], "median_scores": {}, "stems": [ "no woodwinds", - "no no woodwinds" + "woodwinds" ], "target_stem": "no woodwinds" }, @@ -21312,7 +21292,7 @@ "median_scores": {}, "stems": [ "no echo", - "no no echo" + "echo" ], "target_stem": "no echo" }, @@ -21322,7 +21302,7 @@ "median_scores": {}, "stems": [ "no echo", - "no no echo" + "echo" ], "target_stem": "no echo" }, @@ -21332,7 +21312,7 @@ "median_scores": {}, "stems": [ "no reverb", - "no no reverb" + "reverb" ], "target_stem": "no reverb" }, @@ -21366,6 +21346,26 @@ ], "target_stem": "dry" }, + "Reverb_HQ_By_FoxJoy.onnx": { + "model_name": "MDX-Net Model: Reverb HQ By FoxJoy", + "track_scores": [], + "median_scores": {}, + "stems": [ + "reverb", + "no reverb" + ], + "target_stem": "reverb" + }, + "UVR-MDX-NET_Crowd_HQ_1.onnx": { + "model_name": "MDX-Net Model: UVR-MDX-NET Crowd HQ 1 By Aufr33", + "track_scores": [], + "median_scores": {}, + "stems": [ + "no crowd", + "crowd" + ], + "target_stem": "no crowd" + }, "model_bs_roformer_ep_937_sdr_10.5309.ckpt": { "model_name": "Roformer Model: BS-Roformer-Viperx-1053", "track_scores": [], diff --git a/tests/model-metrics/test-all-models.py b/tests/model-metrics/test-all-models.py index a8187db..62fc253 100644 --- a/tests/model-metrics/test-all-models.py +++ b/tests/model-metrics/test-all-models.py @@ -183,53 +183,79 @@ def main(): # Iterate through models and load each one for model_type, models in models_by_type.items(): + logger.info(f"\nProcessing model type: {model_type}") for model_name, model_info in models.items(): test_model = model_info.get("filename") if not test_model: logger.warning(f"No filename found for model {model_name}, skipping...") continue - logger.info(f"Analyzing model data: {test_model}") + logger.info(f"\n=== Analyzing model: {model_name} (filename: {test_model}) ===") try: separator.load_model(model_filename=test_model) model_data = separator.model_instance.model_data + logger.info(f"Raw model_data: {json.dumps(model_data, indent=2)}") # Initialize model entry if it doesn't exist if test_model not in combined_results: + logger.info(f"Initializing new entry for {test_model}") combined_results[test_model] = {"model_name": model_name, "track_scores": [], "median_scores": {}, "stems": [], "target_stem": None} # Handle demucs models specially if test_model in DEMUCS_STEMS: + logger.info(f"Processing as Demucs model: {test_model}") + logger.info(f"Demucs config: {DEMUCS_STEMS[test_model]}") combined_results[test_model]["stems"] = [s.lower() for s in DEMUCS_STEMS[test_model]["instruments"]] combined_results[test_model]["target_stem"] = DEMUCS_STEMS[test_model]["target_instrument"].lower() if DEMUCS_STEMS[test_model]["target_instrument"] else None + logger.info(f"Set stems to: {combined_results[test_model]['stems']}") + logger.info(f"Set target_stem to: {combined_results[test_model]['target_stem']}") # Extract stem information for other models elif "training" in model_data: + logger.info("Processing model with training data") instruments = model_data["training"].get("instruments", []) target = model_data["training"].get("target_instrument") + logger.info(f"Found instruments: {instruments}") + logger.info(f"Found target: {target}") combined_results[test_model]["stems"] = [s.lower() for s in instruments] if instruments else [] combined_results[test_model]["target_stem"] = target.lower() if target else None + logger.info(f"Set stems to: {combined_results[test_model]['stems']}") + logger.info(f"Set target_stem to: {combined_results[test_model]['target_stem']}") elif "primary_stem" in model_data: + logger.info("Processing model with primary_stem") primary_stem = model_data["primary_stem"].lower() + logger.info(f"Found primary_stem: {primary_stem}") + if primary_stem == "vocals": other_stem = "instrumental" elif primary_stem == "instrumental": other_stem = "vocals" else: - other_stem = "no " + primary_stem + if primary_stem.startswith("no "): + other_stem = primary_stem[3:] # Remove "no " prefix + else: + other_stem = "no " + primary_stem + logger.info(f"Determined other_stem: {other_stem}") instruments = [primary_stem, other_stem] combined_results[test_model]["stems"] = instruments combined_results[test_model]["target_stem"] = primary_stem + logger.info(f"Set stems to: {combined_results[test_model]['stems']}") + logger.info(f"Set target_stem to: {combined_results[test_model]['target_stem']}") else: + logger.warning(f"No recognized stem information found in model data for {test_model}") combined_results[test_model]["stems"] = [] combined_results[test_model]["target_stem"] = None - logger.info("No stem information found in model data") + + logger.info(f"Final model configuration for {test_model}:") + logger.info(f"Stems: {combined_results[test_model]['stems']}") + logger.info(f"Target stem: {combined_results[test_model]['target_stem']}") except Exception as e: logger.error(f"Error loading model {test_model}: {str(e)}") + logger.exception("Full exception details:") continue # Save the combined results after model inspection