Spaces:
Runtime error
Runtime error
xinwei89
commited on
Commit
•
74373c9
1
Parent(s):
91252a6
check meta
Browse files- app.py +2 -2
- backend.py +3 -0
app.py
CHANGED
@@ -3,8 +3,8 @@ from backend import visualize_image
|
|
3 |
|
4 |
# gradio inputs
|
5 |
image_input = gr.inputs.Image(type="pil", label="Input Image")
|
6 |
-
color_mode_select = gr.inputs.Radio(["Black/white", "Random", "Segmentation"], label="Color Mode")
|
7 |
-
mode_dropdown = gr.inputs.Dropdown(["Trees", "Buildings", "Both"], label="Detection Mode")
|
8 |
|
9 |
tree_threshold_slider = gr.inputs.Slider(0, 1, 0.1, 0.7, label='Set confidence threshold "%" for trees')
|
10 |
building_threshold_slider = gr.inputs.Slider(0, 1, 0.1, 0.7, label='Set confidence threshold "%" for buildings')
|
|
|
3 |
|
4 |
# gradio inputs
|
5 |
image_input = gr.inputs.Image(type="pil", label="Input Image")
|
6 |
+
color_mode_select = gr.inputs.Radio(["Black/white", "Random", "Segmentation"], label="Color Mode", default="Segmentation")
|
7 |
+
mode_dropdown = gr.inputs.Dropdown(["Trees", "Buildings", "Both"], label="Detection Mode", default="Both")
|
8 |
|
9 |
tree_threshold_slider = gr.inputs.Slider(0, 1, 0.1, 0.7, label='Set confidence threshold "%" for trees')
|
10 |
building_threshold_slider = gr.inputs.Slider(0, 1, 0.1, 0.7, label='Set confidence threshold "%" for buildings')
|
backend.py
CHANGED
@@ -90,6 +90,9 @@ def visualize_image(im, mode="BOTH", tree_threshold=0.7, building_threshold=0.7,
|
|
90 |
|
91 |
dataset_names = MetadataCatalog.list()
|
92 |
print(dataset_names)
|
|
|
|
|
|
|
93 |
# category_names = metadata.get("thing_classes")
|
94 |
# visualizer = Visualizer(im[:, :, ::-1],
|
95 |
# metadata=metadata,
|
|
|
90 |
|
91 |
dataset_names = MetadataCatalog.list()
|
92 |
print(dataset_names)
|
93 |
+
metadata = MetadataCatalog.get(dataset_names[0])
|
94 |
+
print("metadata", type(metadata), metadata)
|
95 |
+
print('metadata.get("thing_classes")', type(metadata.get("thing_classes")), metadata.get("thing_classes"))
|
96 |
# category_names = metadata.get("thing_classes")
|
97 |
# visualizer = Visualizer(im[:, :, ::-1],
|
98 |
# metadata=metadata,
|