Spaces:
Build error
Build error
Add an assertion on the input image.
Browse files
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)
|