Spaces:
Sleeping
Sleeping
Commit ·
6fc5b5e
1
Parent(s): b7dc011
Update app.py
Browse filesupdate to make nba team identifying AI
app.py
CHANGED
|
@@ -35,6 +35,21 @@ def load_processor_model(
|
|
| 35 |
return processor, model
|
| 36 |
|
| 37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
async def open_image_url(image_url: str) -> Image:
|
| 39 |
async with aiohttp.ClientSession() as session:
|
| 40 |
async with session.get(image_url) as resp:
|
|
@@ -138,7 +153,11 @@ main = pn.WidgetBox(
|
|
| 138 |
footer_row,
|
| 139 |
)
|
| 140 |
|
| 141 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
pn.template.BootstrapTemplate(
|
| 143 |
title=title,
|
| 144 |
main=main,
|
|
|
|
| 35 |
return processor, model
|
| 36 |
|
| 37 |
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
def get_image_filenames():
|
| 43 |
+
image_filenames = []
|
| 44 |
+
for i in range(1, 31):
|
| 45 |
+
filename = f'image_{i}.jpg' # Assuming the files are named like 'image_1.jpg', 'image_2.jpg', etc.
|
| 46 |
+
image_filenames.append(filename)
|
| 47 |
+
return image_filenames
|
| 48 |
+
|
| 49 |
+
image_list = get_image_filenames()
|
| 50 |
+
print(image_list)
|
| 51 |
+
|
| 52 |
+
|
| 53 |
async def open_image_url(image_url: str) -> Image:
|
| 54 |
async with aiohttp.ClientSession() as session:
|
| 55 |
async with session.get(image_url) as resp:
|
|
|
|
| 153 |
footer_row,
|
| 154 |
)
|
| 155 |
|
| 156 |
+
df = pd.read_csv('nba_teams.csv') # load csv of team file names
|
| 157 |
+
nba_team_list = df[1].tolist()
|
| 158 |
+
|
| 159 |
+
|
| 160 |
+
title = "NBA Team Identifying Expert"
|
| 161 |
pn.template.BootstrapTemplate(
|
| 162 |
title=title,
|
| 163 |
main=main,
|