Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -528,7 +528,7 @@ def server(input, output, session):
|
|
| 528 |
ax_headshot = fig.add_subplot(gs[1, 1])
|
| 529 |
try:
|
| 530 |
if int(sport_id) == 1:
|
| 531 |
-
url = f'https://img.mlbstatic.com/mlb-photos/image/upload/w_640,d_people:generic:headshot:silo:current.png,q_auto:best,f_auto/v1/people/{
|
| 532 |
response = requests.get(url)
|
| 533 |
img = Image.open(BytesIO(response.content))
|
| 534 |
ax_headshot.set_xlim(0, 1)
|
|
@@ -536,7 +536,7 @@ def server(input, output, session):
|
|
| 536 |
ax_headshot.imshow(img, extent=[0, 1, 0, 1], origin='upper')
|
| 537 |
|
| 538 |
else:
|
| 539 |
-
url = f'https://img.mlbstatic.com/mlb-photos/image/upload/c_fill,g_auto/w_640/v1/people/{
|
| 540 |
response = requests.get(url)
|
| 541 |
img = Image.open(BytesIO(response.content))
|
| 542 |
ax_headshot.set_xlim(0, 1)
|
|
|
|
| 528 |
ax_headshot = fig.add_subplot(gs[1, 1])
|
| 529 |
try:
|
| 530 |
if int(sport_id) == 1:
|
| 531 |
+
url = f'https://img.mlbstatic.com/mlb-photos/image/upload/w_640,d_people:generic:headshot:silo:current.png,q_auto:best,f_auto/v1/people/{batter_id}/headshot/silo/current.png'
|
| 532 |
response = requests.get(url)
|
| 533 |
img = Image.open(BytesIO(response.content))
|
| 534 |
ax_headshot.set_xlim(0, 1)
|
|
|
|
| 536 |
ax_headshot.imshow(img, extent=[0, 1, 0, 1], origin='upper')
|
| 537 |
|
| 538 |
else:
|
| 539 |
+
url = f'https://img.mlbstatic.com/mlb-photos/image/upload/c_fill,g_auto/w_640/v1/people/{batter_id}/headshot/milb/current.png'
|
| 540 |
response = requests.get(url)
|
| 541 |
img = Image.open(BytesIO(response.content))
|
| 542 |
ax_headshot.set_xlim(0, 1)
|