Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -8,6 +8,12 @@ JS_FUNC1 = os.getenv("JS_FUNC1")
|
|
8 |
JS_FUNC2 = os.getenv("JS_FUNC2")
|
9 |
|
10 |
def detect(image):
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
result_text = backend.predict(
|
12 |
image=handle_file(image),
|
13 |
api_name="/detect"
|
|
|
8 |
JS_FUNC2 = os.getenv("JS_FUNC2")
|
9 |
|
10 |
def detect(image):
|
11 |
+
try:
|
12 |
+
file_1 = handle_file(image)
|
13 |
+
except Exception as e:
|
14 |
+
gr.Info("Please upload an image file.")
|
15 |
+
return "", "", ""
|
16 |
+
|
17 |
result_text = backend.predict(
|
18 |
image=handle_file(image),
|
19 |
api_name="/detect"
|