Hugging Face
Models
Datasets
Spaces
Community
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
Kazel
/
demo-updated
like
0
Running
on
Zero
App
Files
Files
Community
Fetching metadata from the HF Docker repository...
af476a6
demo-updated
/
utils.py
Kazel
start
0400df3
22 days ago
raw
Copy download link
history
blame
Safe
159 Bytes
import
base64
def
encode_image
(
image_path
):
with
open
(image_path,
"rb"
)
as
image_file:
return
base64.b64encode(image_file.read()).decode(
'utf-8'
)