Spaces:
Sleeping
Sleeping
Commit
·
e1c5d64
1
Parent(s):
61d4fcd
Update app.py
Browse filesfix whatever broke the original app by replacing with original app
app.py
CHANGED
@@ -1,7 +1,4 @@
|
|
1 |
-
import io
|
2 |
-
import random
|
3 |
from typing import List, Tuple
|
4 |
-
import pandas as pd
|
5 |
|
6 |
import aiohttp
|
7 |
import panel as pn
|
@@ -36,21 +33,6 @@ def load_processor_model(
|
|
36 |
return processor, model
|
37 |
|
38 |
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
def get_image_filenames():
|
44 |
-
image_filenames = []
|
45 |
-
for i in range(1, 31):
|
46 |
-
filename = f'image_{i}.jpg' # Assuming the files are named like 'image_1.jpg', 'image_2.jpg', etc.
|
47 |
-
image_filenames.append(filename)
|
48 |
-
return image_filenames
|
49 |
-
|
50 |
-
image_list = get_image_filenames()
|
51 |
-
print(image_list)
|
52 |
-
|
53 |
-
|
54 |
async def open_image_url(image_url: str) -> Image:
|
55 |
async with aiohttp.ClientSession() as session:
|
56 |
async with session.get(image_url) as resp:
|
@@ -152,16 +134,4 @@ main = pn.WidgetBox(
|
|
152 |
input_widgets,
|
153 |
interactive_result,
|
154 |
footer_row,
|
155 |
-
)
|
156 |
-
|
157 |
-
df = pd.read_csv('nba_teams.csv') # load csv of team file names
|
158 |
-
nba_team_list = df[0].tolist()
|
159 |
-
|
160 |
-
|
161 |
-
title = "NBA Team Identifying Expert"
|
162 |
-
pn.template.BootstrapTemplate(
|
163 |
-
title=title,
|
164 |
-
main=main,
|
165 |
-
main_max_width="min(50%, 698px)",
|
166 |
-
header_background="#F08080",
|
167 |
-
).servable(title=title)
|
|
|
|
|
|
|
1 |
from typing import List, Tuple
|
|
|
2 |
|
3 |
import aiohttp
|
4 |
import panel as pn
|
|
|
33 |
return processor, model
|
34 |
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
async def open_image_url(image_url: str) -> Image:
|
37 |
async with aiohttp.ClientSession() as session:
|
38 |
async with session.get(image_url) as resp:
|
|
|
134 |
input_widgets,
|
135 |
interactive_result,
|
136 |
footer_row,
|
137 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|