Update handler.py
Browse files- handler.py +3 -1
handler.py
CHANGED
|
@@ -19,7 +19,9 @@ class EndpointHandler():
|
|
| 19 |
|
| 20 |
def __call__(self, data: Any) -> List[List[Dict[str, float]]]:
|
| 21 |
image = data.pop("image", None)
|
| 22 |
-
|
|
|
|
|
|
|
| 23 |
|
| 24 |
with torch.no_grad():
|
| 25 |
upscaled_image = self.pipeline(low_res_img, num_inference_steps=100, eta=1).images[0]
|
|
|
|
| 19 |
|
| 20 |
def __call__(self, data: Any) -> List[List[Dict[str, float]]]:
|
| 21 |
image = data.pop("image", None)
|
| 22 |
+
# process image
|
| 23 |
+
image = self.decode_base64_image(image)
|
| 24 |
+
low_res_img = image#.resize((128, 128))
|
| 25 |
|
| 26 |
with torch.no_grad():
|
| 27 |
upscaled_image = self.pipeline(low_res_img, num_inference_steps=100, eta=1).images[0]
|