From ad570f0a75a21e015b3ca66561d78309bf59f324 Mon Sep 17 00:00:00 2001 From: Aryan Kothari <87589047+thearyadev@users.noreply.github.com> Date: Thu, 15 Feb 2024 18:48:17 -0500 Subject: [PATCH] use param model name instead of hard string --- leaderboards/leaderboard_parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/leaderboards/leaderboard_parser.py b/leaderboards/leaderboard_parser.py index 2d6016dc..ad13c7b1 100644 --- a/leaderboards/leaderboard_parser.py +++ b/leaderboards/leaderboard_parser.py @@ -100,7 +100,7 @@ def crop_split_column(pil_image: ImageType) -> list[ImageType]: break return list(reversed(result)) # Hero placement has been reversed in Season 9 (blizzard moment.) -def parse_leaderboard_to_leaderboard_entries(leaderboard_image: ImageType, region: Region, role: Role) -> list[LeaderboardEntry]: +def parse_leaderboard_to_leaderboard_entries(leaderboard_image: ImageType, region: Region, role: Role, model_name) -> list[LeaderboardEntry]: hero_comp = Heroes() hero_section = crop_to_hero_section(leaderboard_image) row_entries = crop_split_row(hero_section) @@ -109,7 +109,7 @@ def parse_leaderboard_to_leaderboard_entries(leaderboard_image: ImageType, regio for row in split_column_entries: # each record (10) results.append(LeaderboardEntry( - heroes=[hero_comp.predict_hero_name(hero_image, Path("./models/tm")) for hero_image in row], + heroes=[hero_comp.predict_hero_name(hero_image, Path(f"./models/{model_name}")) for hero_image in row], role=role, region=region