peterhartwigCF commited on
Commit
28d0c26
·
verified ·
1 Parent(s): 5c26863

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -20
app.py CHANGED
@@ -86,26 +86,28 @@ def gradio_interface(input_image, click_x, click_y):
86
  return visualization, swatch, detailed_fabric
87
 
88
  # Create Gradio interface
89
- iface = gr.Interface(
90
- fn=gradio_interface,
91
- inputs=[
92
- gr.Image(type="numpy"),
93
- gr.Slider(0, 1000, label="Click X"),
94
- gr.Slider(0, 1000, label="Click Y")
95
- ],
96
- outputs=[
97
- gr.Image(type="numpy", label="Segmentation"),
98
- gr.Image(type="numpy", label="Color Swatch"),
99
- gr.Image(type="numpy", label="Detailed Fabric")
100
- ],
101
- title="Fabric Analyzer",
102
- description="Upload an image or choose from examples. Click on the garment to analyze fabric and color.",
103
- examples=[
104
- ["blue_shirt.png", 400, 500],
105
- ["polo.png", 400, 500],
106
- ["dress.jpg", 400, 500]
107
- ]
108
- )
 
 
109
 
110
  if __name__ == "__main__":
111
  iface.launch()
 
86
  return visualization, swatch, detailed_fabric
87
 
88
  # Create Gradio interface
89
+ with gr.Blocks(css="styling.css") as demo:
90
+
91
+ iface = gr.Interface(
92
+ fn=gradio_interface,
93
+ inputs=[
94
+ gr.Image(type="numpy"),
95
+ gr.Slider(0, 1000, label="Click X"),
96
+ gr.Slider(0, 1000, label="Click Y")
97
+ ],
98
+ outputs=[
99
+ gr.Image(type="numpy", label="Segmentation"),
100
+ gr.Image(type="numpy", label="Color Swatch"),
101
+ gr.Image(type="numpy", label="Detailed Fabric")
102
+ ],
103
+ title="Fabric Analyzer",
104
+ description="Upload an image or choose from examples. Click on the garment to analyze fabric and color.",
105
+ examples=[
106
+ ["blue_shirt.png", 400, 500],
107
+ ["polo.png", 400, 500],
108
+ ["dress.jpg", 400, 500]
109
+ ]
110
+ )
111
 
112
  if __name__ == "__main__":
113
  iface.launch()