tsbir / test.py
tcm03
Add model checkpoint with Git LFS
b6ff56b
raw
history blame
676 Bytes
from handler import EndpointHandler
import base64
# Helper function to encode an image to Base64
def encode_image_to_base64(image_path):
with open(image_path, "rb") as image_file:
return base64.b64encode(image_file.read()).decode("utf-8")
# Initialize the handler
handler = EndpointHandler(path=".")
# Prepare sample inputs
image_path = "path_to_your_sketch_image.jpg" # Replace with your image path
base64_image = encode_image_to_base64(image_path)
text_query = "A pink flower"
# Create payload
payload = {
"image": base64_image,
"text": text_query
}
# Run the handler
response = handler(payload)
# Show results
print("Fused Embedding:", response)