Spaces:
Sleeping
Sleeping
Commit ·
47720ee
1
Parent(s): 96f8696
Update app.py
Browse files
app.py
CHANGED
|
@@ -135,17 +135,33 @@ def process_image(img, option1, option2):
|
|
| 135 |
return cv2.cvtColor(output_frame, cv2.COLOR_BGR2RGB)
|
| 136 |
|
| 137 |
|
| 138 |
-
#
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
gr.
|
| 145 |
-
gr.
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
)
|
| 150 |
-
|
| 151 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
return cv2.cvtColor(output_frame, cv2.COLOR_BGR2RGB)
|
| 136 |
|
| 137 |
|
| 138 |
+
# def process_image(img, option1, option2, button):
|
| 139 |
+
# frame = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
|
| 140 |
+
# output_frame = final(option1, option2, frame)
|
| 141 |
+
# return cv2.cvtColor(output_frame, cv2.COLOR_BGR2RGB)
|
| 142 |
+
with gr.Blocks() as demo:
|
| 143 |
+
with gr.Row():
|
| 144 |
+
img=gr.Image(source="webcam")
|
| 145 |
+
io=gr.Image()
|
| 146 |
+
|
| 147 |
+
r1=gr.Radio(["Person", "Background", "Whole Frame"])
|
| 148 |
+
r2=gr.Radio(["Blur", "Sepia", "Pixelate", "Emboss", "Edge Enhance", "Increase Brightness", "Decrease Brightness"])
|
| 149 |
+
btn = gr.Button(value="Submit")
|
| 150 |
+
btn.click(process_image, inputs=[img,r1,r2], outputs=[io])
|
| 151 |
+
|
| 152 |
+
|
| 153 |
+
|
| 154 |
+
# iface = gr.Interface(
|
| 155 |
+
# fn=process_image,
|
| 156 |
+
# inputs=[
|
| 157 |
+
# gr.Image(source="webcam"),
|
| 158 |
+
# gr.Radio(["Person", "Background", "Whole Frame"]),
|
| 159 |
+
# gr.Radio(["Blur", "Sepia", "Pixelate", "Emboss", "Edge Enhance", "Increase Brightness", "Decrease Brightness"]),
|
| 160 |
+
# gr.Button(label="Apply Effect")
|
| 161 |
+
# ],
|
| 162 |
+
# outputs=gr.Image(),
|
| 163 |
+
# live=True
|
| 164 |
+
# )
|
| 165 |
+
|
| 166 |
+
# iface.launch()
|
| 167 |
+
demo.launch()
|