Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -48,8 +48,8 @@ def image_to_base64(image):
|
|
48 |
img_str = base64.b64encode(buffered.getvalue()).decode('utf-8')
|
49 |
return img_str
|
50 |
|
51 |
-
# Define the Gradio
|
52 |
-
|
53 |
fn=crop_face,
|
54 |
inputs="text",
|
55 |
outputs="text",
|
@@ -57,13 +57,13 @@ interface = gr.Interface(
|
|
57 |
description="Input a base64 encoded image to get a base64 encoded cropped face."
|
58 |
)
|
59 |
|
60 |
-
|
61 |
fn=image_to_base64,
|
62 |
-
inputs=gr.
|
63 |
outputs="text",
|
64 |
title="Image to Base64 Converter",
|
65 |
-
description="Upload an image to convert it to Base64 encoded string."
|
66 |
)
|
67 |
|
68 |
if __name__ == "__main__":
|
69 |
-
gr.TabbedInterface([
|
|
|
48 |
img_str = base64.b64encode(buffered.getvalue()).decode('utf-8')
|
49 |
return img_str
|
50 |
|
51 |
+
# Define the Gradio interfaces
|
52 |
+
face_crop_interface = gr.Interface(
|
53 |
fn=crop_face,
|
54 |
inputs="text",
|
55 |
outputs="text",
|
|
|
57 |
description="Input a base64 encoded image to get a base64 encoded cropped face."
|
58 |
)
|
59 |
|
60 |
+
base64_converter_interface = gr.Interface(
|
61 |
fn=image_to_base64,
|
62 |
+
inputs=gr.Image(),
|
63 |
outputs="text",
|
64 |
title="Image to Base64 Converter",
|
65 |
+
description="Upload an image to convert it to a Base64 encoded string."
|
66 |
)
|
67 |
|
68 |
if __name__ == "__main__":
|
69 |
+
gr.TabbedInterface([face_crop_interface, base64_converter_interface], ["Crop Face", "Convert to Base64"]).launch(share=True)
|