Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
try:
|
| 2 |
import spaces
|
|
|
|
| 3 |
IN_SPACES = True
|
| 4 |
except ImportError:
|
| 5 |
from functools import wraps
|
|
@@ -123,6 +124,7 @@ def detect(img, object):
|
|
| 123 |
w, h = img.size
|
| 124 |
if w > 768 or h > 768:
|
| 125 |
img = Resize(768)(img)
|
|
|
|
| 126 |
|
| 127 |
objs = moondream.detect(img, object, tokenizer)
|
| 128 |
draw_image = ImageDraw.Draw(img)
|
|
|
|
| 1 |
try:
|
| 2 |
import spaces
|
| 3 |
+
|
| 4 |
IN_SPACES = True
|
| 5 |
except ImportError:
|
| 6 |
from functools import wraps
|
|
|
|
| 124 |
w, h = img.size
|
| 125 |
if w > 768 or h > 768:
|
| 126 |
img = Resize(768)(img)
|
| 127 |
+
w, h = img.size
|
| 128 |
|
| 129 |
objs = moondream.detect(img, object, tokenizer)
|
| 130 |
draw_image = ImageDraw.Draw(img)
|