Commit
•
21e47f9
1
Parent(s):
4f2b205
Update README.md
Browse files
README.md
CHANGED
@@ -49,21 +49,12 @@ from io import BytesIO
|
|
49 |
ENDPOINT_URL = ""
|
50 |
HF_TOKEN = ""
|
51 |
|
52 |
-
import base64
|
53 |
-
from PIL import Image
|
54 |
-
from io import BytesIO
|
55 |
-
|
56 |
# helper image utils
|
57 |
def encode_image(image_path):
|
58 |
with open(image_path, "rb") as i:
|
59 |
b64 = base64.b64encode(i.read())
|
60 |
return b64.decode("utf-8")
|
61 |
|
62 |
-
prompt = "Face of a bengal cat, high resolution, sitting on a park bench"
|
63 |
-
|
64 |
-
# test the handler
|
65 |
-
pred = my_handler(request)
|
66 |
-
|
67 |
|
68 |
def predict(prompt, image, mask_image):
|
69 |
image = encode_image(image)
|
|
|
49 |
ENDPOINT_URL = ""
|
50 |
HF_TOKEN = ""
|
51 |
|
|
|
|
|
|
|
|
|
52 |
# helper image utils
|
53 |
def encode_image(image_path):
|
54 |
with open(image_path, "rb") as i:
|
55 |
b64 = base64.b64encode(i.read())
|
56 |
return b64.decode("utf-8")
|
57 |
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
def predict(prompt, image, mask_image):
|
60 |
image = encode_image(image)
|