Spaces:
Running
on
Zero
Running
on
Zero
Delete breed_detection.py
Browse files- breed_detection.py +0 -33
breed_detection.py
DELETED
@@ -1,33 +0,0 @@
|
|
1 |
-
import re
|
2 |
-
import gradio as gr
|
3 |
-
from PIL import Image
|
4 |
-
|
5 |
-
def create_detection_tab(predict_fn, example_images):
|
6 |
-
with gr.TabItem("Breed Detection"):
|
7 |
-
gr.HTML("<p style='text-align: center;'>Upload a picture of a dog, and the model will predict its breed and provide detailed information!</p>")
|
8 |
-
gr.HTML("<p style='text-align: center; color: #666; font-size: 0.9em;'>Note: The model's predictions may not always be 100% accurate, and it is recommended to use the results as a reference.</p>")
|
9 |
-
|
10 |
-
with gr.Row():
|
11 |
-
input_image = gr.Image(label="Upload a dog image", type="pil")
|
12 |
-
output_image = gr.Image(label="Annotated Image")
|
13 |
-
|
14 |
-
output = gr.HTML(label="Prediction Results")
|
15 |
-
initial_state = gr.State()
|
16 |
-
|
17 |
-
input_image.change(
|
18 |
-
predict_fn,
|
19 |
-
inputs=input_image,
|
20 |
-
outputs=[output, output_image, initial_state]
|
21 |
-
)
|
22 |
-
|
23 |
-
gr.Examples(
|
24 |
-
examples=example_images,
|
25 |
-
inputs=input_image
|
26 |
-
)
|
27 |
-
|
28 |
-
return {
|
29 |
-
'input_image': input_image,
|
30 |
-
'output_image': output_image,
|
31 |
-
'output': output,
|
32 |
-
'initial_state': initial_state
|
33 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|