Spaces:
Running
Running
Handle empty image input
Browse files
app.py
CHANGED
@@ -43,6 +43,8 @@ class App:
|
|
43 |
return model
|
44 |
|
45 |
def __call__(self, model_name, image):
|
|
|
|
|
46 |
model = self._get_model(model_name)
|
47 |
image = self._preprocess(image.convert('RGB')).unsqueeze(0)
|
48 |
# Greedy decoding
|
|
|
43 |
return model
|
44 |
|
45 |
def __call__(self, model_name, image):
|
46 |
+
if image is None:
|
47 |
+
return ''
|
48 |
model = self._get_model(model_name)
|
49 |
image = self._preprocess(image.convert('RGB')).unsqueeze(0)
|
50 |
# Greedy decoding
|