Kosmos2-endpoint / test.py
Yan
added test script and data for local handler testing, fixed syntax error in handler script
2ca44ee
raw
history blame contribute delete
255 Bytes
from handler import EndpointHandler
from PIL import Image
import base64
# init handler
my_handler = EndpointHandler(path=".")
# prepare sample payload
image = Image.open("test.png")
payload = {"image": base64.b64encode(image)}
pred=my_handler(payload)