Hugging Face
Models
Datasets
Spaces
Buckets
new
Docs
Enterprise
Pricing
Website
Tasks
HuggingChat
Collections
Languages
Organizations
Community
Blog
Posts
Daily Papers
Hardware
Learn
Discord
Forum
GitHub
Solutions
Team & Enterprise
Hugging Face PRO
Enterprise Support
Inference Providers
Inference Endpoints
Storage Buckets
Log In
Sign Up
Spaces:
Kazel
/
demo
like
0
Build error
App
Files
Files
Community
Fetching metadata from the HF Docker repository...
main
demo
/
utils.py
Kazel
all
065b6ad
over 1 year ago
Raw
Download with hf CLI
Copy download link
History
Blame
Contribute
Delete
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'
)