ZhengPeng7 commited on
Commit
9e40d13
1 Parent(s): e4862f5

Add an assertion on the input image.

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -60,6 +60,8 @@ birefnet.eval()
60
 
61
  @spaces.GPU
62
  def predict(image, resolution, weights_file):
 
 
63
  if isinstance(image, str):
64
  response = requests.get(image)
65
  image_data = BytesIO(response.content)
 
60
 
61
  @spaces.GPU
62
  def predict(image, resolution, weights_file):
63
+ assert (image is not None), 'AssertionError: image cannot be None.'
64
+
65
  if isinstance(image, str):
66
  response = requests.get(image)
67
  image_data = BytesIO(response.content)