chris-propeller commited on
Commit
349db12
·
1 Parent(s): 050a111
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -60,6 +60,7 @@ def sam3_inference(image, text_prompt, confidence_threshold=0.5):
60
  except Exception as e:
61
  raise Exception(f"SAM3 inference error: {str(e)}")
62
 
 
63
  def gradio_interface(image, text_prompt, confidence_threshold):
64
  """Gradio interface wrapper for UI"""
65
  import numpy as np
@@ -83,6 +84,7 @@ def gradio_interface(image, text_prompt, confidence_threshold):
83
  except Exception as e:
84
  return f"Error: {str(e)}", None
85
 
 
86
  def api_predict(image, text_prompt, confidence_threshold):
87
  """API prediction function for simple Gradio API"""
88
  import numpy as np
@@ -122,6 +124,7 @@ def api_predict(image, text_prompt, confidence_threshold):
122
  except Exception as e:
123
  return {"error": str(e)}
124
 
 
125
  def sam2_compatible_api(data):
126
  """
127
  SAM2-compatible API endpoint with SAM3 extensions
 
60
  except Exception as e:
61
  raise Exception(f"SAM3 inference error: {str(e)}")
62
 
63
+ @spaces.GPU
64
  def gradio_interface(image, text_prompt, confidence_threshold):
65
  """Gradio interface wrapper for UI"""
66
  import numpy as np
 
84
  except Exception as e:
85
  return f"Error: {str(e)}", None
86
 
87
+ @spaces.GPU
88
  def api_predict(image, text_prompt, confidence_threshold):
89
  """API prediction function for simple Gradio API"""
90
  import numpy as np
 
124
  except Exception as e:
125
  return {"error": str(e)}
126
 
127
+ @spaces.GPU
128
  def sam2_compatible_api(data):
129
  """
130
  SAM2-compatible API endpoint with SAM3 extensions