Spaces:
Runtime error
Runtime error
danielquillanroxas
commited on
Commit
ยท
1830edb
1
Parent(s):
13ad668
changed stuff
Browse files
app.py
CHANGED
|
@@ -70,9 +70,6 @@ def detect_and_blur(image):
|
|
| 70 |
message = f"Detected and blurred {detections['faces']} faces and {detections['plates']} license plates/text regions"
|
| 71 |
return result_img, message
|
| 72 |
|
| 73 |
-
# Create example_images directory if it doesn't exist
|
| 74 |
-
os.makedirs("examples", exist_ok=True)
|
| 75 |
-
|
| 76 |
# Define the Gradio interface
|
| 77 |
title = "Privacy Protector: Automatic Blurring"
|
| 78 |
description = (
|
|
@@ -80,9 +77,10 @@ description = (
|
|
| 80 |
"This model uses YOLOv8 to detect and blur sensitive content."
|
| 81 |
)
|
| 82 |
|
|
|
|
| 83 |
interface = gr.Interface(
|
| 84 |
fn=detect_and_blur,
|
| 85 |
-
inputs=gr.Image(),
|
| 86 |
outputs=[
|
| 87 |
gr.Image(label="Processed Image"),
|
| 88 |
gr.Textbox(label="Detection Results")
|
|
@@ -90,12 +88,11 @@ interface = gr.Interface(
|
|
| 90 |
title=title,
|
| 91 |
description=description,
|
| 92 |
examples=[
|
| 93 |
-
# Following your friend's format: list of single-item lists
|
| 94 |
['examples/example1.jpg'],
|
| 95 |
['examples/example2.jpg']
|
| 96 |
]
|
| 97 |
)
|
| 98 |
|
| 99 |
-
# Launch the app
|
| 100 |
if __name__ == "__main__":
|
| 101 |
-
interface.launch()
|
|
|
|
| 70 |
message = f"Detected and blurred {detections['faces']} faces and {detections['plates']} license plates/text regions"
|
| 71 |
return result_img, message
|
| 72 |
|
|
|
|
|
|
|
|
|
|
| 73 |
# Define the Gradio interface
|
| 74 |
title = "Privacy Protector: Automatic Blurring"
|
| 75 |
description = (
|
|
|
|
| 77 |
"This model uses YOLOv8 to detect and blur sensitive content."
|
| 78 |
)
|
| 79 |
|
| 80 |
+
# Using the EXACT format your friend used - lists of single-item lists
|
| 81 |
interface = gr.Interface(
|
| 82 |
fn=detect_and_blur,
|
| 83 |
+
inputs=gr.Image(),
|
| 84 |
outputs=[
|
| 85 |
gr.Image(label="Processed Image"),
|
| 86 |
gr.Textbox(label="Detection Results")
|
|
|
|
| 88 |
title=title,
|
| 89 |
description=description,
|
| 90 |
examples=[
|
|
|
|
| 91 |
['examples/example1.jpg'],
|
| 92 |
['examples/example2.jpg']
|
| 93 |
]
|
| 94 |
)
|
| 95 |
|
| 96 |
+
# Launch the app with the correct server parameters
|
| 97 |
if __name__ == "__main__":
|
| 98 |
+
interface.launch(server_name="0.0.0.0", server_port=7860)
|