Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
316d81d
1
Parent(s):
325902e
Update app
Browse files- app.py +2 -0
- requirements.txt +2 -0
app.py
CHANGED
|
@@ -4,6 +4,7 @@ from io import BytesIO
|
|
| 4 |
from pathlib import Path
|
| 5 |
|
| 6 |
import glob
|
|
|
|
| 7 |
import numpy as np
|
| 8 |
import gradio as gr
|
| 9 |
import rasterio as rio
|
|
@@ -164,6 +165,7 @@ def _bar_chart(top_scores, img_name, cmap) -> str:
|
|
| 164 |
return f'<img src="data:image/png;base64,{b64}" style="display:block;margin:auto;width:{IMG_PX}px;" />'
|
| 165 |
|
| 166 |
|
|
|
|
| 167 |
def classify(images, class_text):
|
| 168 |
class_names = [c.strip() for c in class_text.split(",") if c.strip()]
|
| 169 |
cards = []
|
|
|
|
| 4 |
from pathlib import Path
|
| 5 |
|
| 6 |
import glob
|
| 7 |
+
import spaces
|
| 8 |
import numpy as np
|
| 9 |
import gradio as gr
|
| 10 |
import rasterio as rio
|
|
|
|
| 165 |
return f'<img src="data:image/png;base64,{b64}" style="display:block;margin:auto;width:{IMG_PX}px;" />'
|
| 166 |
|
| 167 |
|
| 168 |
+
@spaces.GPU
|
| 169 |
def classify(images, class_text):
|
| 170 |
class_names = [c.strip() for c in class_text.split(",") if c.strip()]
|
| 171 |
cards = []
|
requirements.txt
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
|
|
|
|
|
| 1 |
gradio>=4.31.0
|
| 2 |
plotly
|
| 3 |
rasterio
|
|
|
|
| 1 |
+
--extra-index-url https://download.pytorch.org/whl/cu113
|
| 2 |
+
torch
|
| 3 |
gradio>=4.31.0
|
| 4 |
plotly
|
| 5 |
rasterio
|