Spaces:
Sleeping
Sleeping
revert model upload
Browse files
app.py
CHANGED
@@ -47,11 +47,9 @@ def process_image(sample_choice, uploaded_image, yolo_versions):
|
|
47 |
return result_images
|
48 |
|
49 |
|
50 |
-
def view_model(
|
51 |
-
|
52 |
-
|
53 |
-
#netron_url = start_netron_server(file_path)
|
54 |
-
if True:
|
55 |
# Embed the Netron viewer using an iframe with the generated URL
|
56 |
iframe_html = f"""
|
57 |
<iframe
|
@@ -93,10 +91,10 @@ with gr.Blocks(css=custom_css) as interface:
|
|
93 |
value=default_sample,
|
94 |
)
|
95 |
|
96 |
-
upload_image = gr.Image(
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
|
101 |
selected_models = gr.CheckboxGroup(
|
102 |
choices=["yolov5", "yolov8s"],
|
@@ -121,7 +119,7 @@ with gr.Blocks(css=custom_css) as interface:
|
|
121 |
height=500,
|
122 |
)
|
123 |
|
124 |
-
model_file_input = gr.File(label="Upload Model File", type="filepath") # Fixed type here
|
125 |
netron_display = gr.HTML(label="Netron Visualization")
|
126 |
|
127 |
sample_selection.change(
|
@@ -138,7 +136,7 @@ with gr.Blocks(css=custom_css) as interface:
|
|
138 |
|
139 |
model_file_input.change(
|
140 |
fn=view_model,
|
141 |
-
inputs=
|
142 |
outputs=netron_display,
|
143 |
)
|
144 |
|
|
|
47 |
return result_images
|
48 |
|
49 |
|
50 |
+
def view_model(selected_models):
|
51 |
+
for model in selected_models[0]:
|
52 |
+
if model == "yolov5":
|
|
|
|
|
53 |
# Embed the Netron viewer using an iframe with the generated URL
|
54 |
iframe_html = f"""
|
55 |
<iframe
|
|
|
91 |
value=default_sample,
|
92 |
)
|
93 |
|
94 |
+
#upload_image = gr.Image(
|
95 |
+
# label="Upload an Image",
|
96 |
+
# type="pil",
|
97 |
+
# )
|
98 |
|
99 |
selected_models = gr.CheckboxGroup(
|
100 |
choices=["yolov5", "yolov8s"],
|
|
|
119 |
height=500,
|
120 |
)
|
121 |
|
122 |
+
#model_file_input = gr.File(label="Upload Model File", type="filepath") # Fixed type here
|
123 |
netron_display = gr.HTML(label="Netron Visualization")
|
124 |
|
125 |
sample_selection.change(
|
|
|
136 |
|
137 |
model_file_input.change(
|
138 |
fn=view_model,
|
139 |
+
inputs=selected_models,
|
140 |
outputs=netron_display,
|
141 |
)
|
142 |
|