Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -488,32 +488,32 @@ def server(input, output, session):
|
|
488 |
imagebox = OffsetImage(im, zoom = 0.3)
|
489 |
ab = AnnotationBbox(imagebox, (0.125, 0.8), frameon = False)
|
490 |
ax.add_artist(ab)
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
|
518 |
ax.text(s = f'2024 {dict_level[sport_id_input]} Metrics',
|
519 |
|
|
|
488 |
imagebox = OffsetImage(im, zoom = 0.3)
|
489 |
ab = AnnotationBbox(imagebox, (0.125, 0.8), frameon = False)
|
490 |
ax.add_artist(ab)
|
491 |
+
try:
|
492 |
+
if 'parentOrgId' in player_bio['people'][0]['currentTeam']:
|
493 |
+
url = team_logos[team_logos['id'] == player_bio['people'][0]['currentTeam']['parentOrgId']]['imageLink'].values[0]
|
494 |
+
|
495 |
+
im = plt.imread(url)
|
496 |
+
# response = requests.get(url)
|
497 |
+
# im = Image.open(BytesIO(response.content))
|
498 |
+
# im = plt.imread(team_logos[team_logos['id'] == player_bio['people'][0]['currentTeam']['parentOrgId']]['imageLink'].values[0])
|
499 |
+
# ax = fig.add_axes([0,0,1,0.85], anchor='C', zorder=1)
|
500 |
+
imagebox = OffsetImage(im, zoom = 0.225)
|
501 |
+
ab = AnnotationBbox(imagebox, (0.875, 0.8), frameon = False)
|
502 |
+
ax.add_artist(ab)
|
503 |
+
except KeyError:
|
504 |
+
print('')
|
505 |
+
# url = team_logos[team_logos['id'] == player_bio['people'][0]['currentTeam']['id']]['imageLink'].values[0]
|
506 |
+
# im = plt.imread(team_logos[team_logos['id'] == player_bio['people'][0]['currentTeam']['id']]['imageLink'].values[0])
|
507 |
+
|
508 |
+
# # im = plt.imread(url)
|
509 |
+
# # response = requests.get(url)
|
510 |
+
# # im = Image.open(BytesIO(response.content))
|
511 |
+
# #im = plt.imread(team_logos[team_logos['id'] == player_bio['people'][0]['currentTeam']['parentOrgId']]['imageLink'].values[0])
|
512 |
+
|
513 |
+
# # ax = fig.add_axes([0,0,1,0.85], anchor='C', zorder=1)
|
514 |
+
# imagebox = OffsetImage(im, zoom = 0.225)
|
515 |
+
# ab = AnnotationBbox(imagebox, (0.875, 0.8), frameon = False)
|
516 |
+
# ax.add_artist(ab)
|
517 |
|
518 |
ax.text(s = f'2024 {dict_level[sport_id_input]} Metrics',
|
519 |
|