Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -78,27 +78,27 @@ def process_images(images, job_number, job_name, job_address):
|
|
| 78 |
|
| 79 |
return output_path
|
| 80 |
|
| 81 |
-
# HTML code
|
| 82 |
-
|
| 83 |
<div style="text-align: center;">
|
| 84 |
-
<img src="
|
|
|
|
| 85 |
</div>
|
| 86 |
"""
|
| 87 |
|
| 88 |
-
# Create the Gradio interface with
|
| 89 |
iface = gr.Interface(
|
| 90 |
fn=process_images,
|
| 91 |
inputs=[
|
| 92 |
-
gr.HTML(logo_html), # Embed logo as HTML at the top
|
| 93 |
gr.File(file_count="multiple", type="filepath", label="Upload Images"),
|
| 94 |
gr.Textbox(label="Job Number"),
|
| 95 |
gr.Textbox(label="Job Name"),
|
| 96 |
gr.Textbox(label="Job Address")
|
| 97 |
],
|
| 98 |
outputs=gr.File(label="Download Report"),
|
| 99 |
-
title=
|
| 100 |
-
description="Upload images and provide job details to generate a Word report with job information and 2x2 image layout."
|
| 101 |
)
|
| 102 |
|
| 103 |
-
# Launch the app
|
| 104 |
-
iface.launch()
|
|
|
|
| 78 |
|
| 79 |
return output_path
|
| 80 |
|
| 81 |
+
# HTML code to display the logo and title together
|
| 82 |
+
title_with_logo = """
|
| 83 |
<div style="text-align: center;">
|
| 84 |
+
<img src="logo.png" alt="Logo" width="100"><br>
|
| 85 |
+
<h1>HKC Report Generator</h1>
|
| 86 |
</div>
|
| 87 |
"""
|
| 88 |
|
| 89 |
+
# Create the Gradio interface with job inputs
|
| 90 |
iface = gr.Interface(
|
| 91 |
fn=process_images,
|
| 92 |
inputs=[
|
|
|
|
| 93 |
gr.File(file_count="multiple", type="filepath", label="Upload Images"),
|
| 94 |
gr.Textbox(label="Job Number"),
|
| 95 |
gr.Textbox(label="Job Name"),
|
| 96 |
gr.Textbox(label="Job Address")
|
| 97 |
],
|
| 98 |
outputs=gr.File(label="Download Report"),
|
| 99 |
+
title=title_with_logo,
|
| 100 |
+
description="Upload images and provide job details to generate a Word report with job information and 2x2 image layout.",
|
| 101 |
)
|
| 102 |
|
| 103 |
+
# Launch the app with shareable link option
|
| 104 |
+
iface.launch(share=True)
|