output test
Browse files- handler.py +10 -2
handler.py
CHANGED
@@ -50,6 +50,14 @@ class EndpointHandler:
|
|
50 |
height=height,
|
51 |
width=width,
|
52 |
)
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
-
#
|
55 |
-
return
|
|
|
|
|
|
|
|
50 |
height=height,
|
51 |
width=width,
|
52 |
)
|
53 |
+
|
54 |
+
# encode image as base 64
|
55 |
+
buffered = BytesIO()
|
56 |
+
out.images[0].save(buffered, format="JPEG")
|
57 |
+
img_str = base64.b64encode(buffered.getvalue())
|
58 |
|
59 |
+
# postprocess the prediction
|
60 |
+
return {"image": img_str.decode()}
|
61 |
+
|
62 |
+
# # return first generate PIL image
|
63 |
+
# return out.images[0]
|