Zhu-FaceOnLive commited on
Commit
2224e27
·
verified ·
1 Parent(s): d6c5c19

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
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"