Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -55,9 +55,38 @@ def process_images(front_img, side_img, real_height_cm):
|
|
55 |
measurements_df.to_csv(csv_file, mode='a', header=False, index=False)
|
56 |
|
57 |
# Prepare measurements for display
|
58 |
-
measurement_display = measurements_df.to_html(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
|
60 |
return f"""
|
|
|
61 |
<h3 style="text-align: center;">Body Measurements</h3>
|
62 |
<div style="text-align: center;">
|
63 |
<img src="https://huggingface.co/front-logo.png" alt="Hugging Face Logo" style="width: 100px; margin-bottom: 20px;"/>
|
@@ -65,7 +94,7 @@ def process_images(front_img, side_img, real_height_cm):
|
|
65 |
{measurement_display}
|
66 |
"""
|
67 |
|
68 |
-
#
|
69 |
interface = gr.Interface(
|
70 |
fn=process_images,
|
71 |
inputs=[
|
|
|
55 |
measurements_df.to_csv(csv_file, mode='a', header=False, index=False)
|
56 |
|
57 |
# Prepare measurements for display
|
58 |
+
measurement_display = measurements_df.to_html(
|
59 |
+
index=False,
|
60 |
+
justify="center",
|
61 |
+
border=1,
|
62 |
+
classes="styled-table"
|
63 |
+
)
|
64 |
+
|
65 |
+
# Add CSS styling for the table
|
66 |
+
css_styles = """
|
67 |
+
<style>
|
68 |
+
.styled-table {
|
69 |
+
width: 80%;
|
70 |
+
margin: 0 auto;
|
71 |
+
border-collapse: collapse;
|
72 |
+
font-size: 16px;
|
73 |
+
text-align: center;
|
74 |
+
}
|
75 |
+
.styled-table th, .styled-table td {
|
76 |
+
border: 1px solid #dddddd;
|
77 |
+
padding: 8px;
|
78 |
+
}
|
79 |
+
.styled-table th {
|
80 |
+
background-color: #f4f4f4;
|
81 |
+
}
|
82 |
+
.styled-table tr:nth-child(even) {
|
83 |
+
background-color: #f9f9f9;
|
84 |
+
}
|
85 |
+
</style>
|
86 |
+
"""
|
87 |
|
88 |
return f"""
|
89 |
+
{css_styles}
|
90 |
<h3 style="text-align: center;">Body Measurements</h3>
|
91 |
<div style="text-align: center;">
|
92 |
<img src="https://huggingface.co/front-logo.png" alt="Hugging Face Logo" style="width: 100px; margin-bottom: 20px;"/>
|
|
|
94 |
{measurement_display}
|
95 |
"""
|
96 |
|
97 |
+
# Update the Gradio output
|
98 |
interface = gr.Interface(
|
99 |
fn=process_images,
|
100 |
inputs=[
|