Spaces:
Running
on
T4
Running
on
T4
Deals with No Image when working with user image
Browse files
app.py
CHANGED
@@ -33,6 +33,9 @@ def generate_imgs_from_user(image,
|
|
33 |
model: EvalModel, baseline: BaselineModel,
|
34 |
physics: PhysicsWithGenerator, use_gen: bool,
|
35 |
metrics: List[Metric]):
|
|
|
|
|
|
|
36 |
# PIL image -> torch.Tensor
|
37 |
x = transforms.ToTensor()(image).unsqueeze(0).to('cuda')
|
38 |
|
|
|
33 |
model: EvalModel, baseline: BaselineModel,
|
34 |
physics: PhysicsWithGenerator, use_gen: bool,
|
35 |
metrics: List[Metric]):
|
36 |
+
if image is None:
|
37 |
+
return None, None, None, None, None, None, None, None
|
38 |
+
|
39 |
# PIL image -> torch.Tensor
|
40 |
x = transforms.ToTensor()(image).unsqueeze(0).to('cuda')
|
41 |
|