Spaces:
Running
Running
Commit
·
7b79cdc
1
Parent(s):
fb060e0
Refactor inference function to remove diameter parameter and enhance theme configuration with additional fonts.
Browse files
app.py
CHANGED
@@ -53,7 +53,7 @@ model.det_conf_thresh = 0.1
|
|
53 |
def inference(image):
|
54 |
"""Run inference on image and return annotated image."""
|
55 |
results = model(image)
|
56 |
-
return results.draw(image
|
57 |
|
58 |
# Flagging
|
59 |
dataset_name = "SEA-AI/crowdsourced-sea-images"
|
@@ -61,7 +61,10 @@ hf_writer = HuggingFaceDatasetSaver(get_token(), dataset_name)
|
|
61 |
flagged_counter = FlaggedCounter(dataset_name)
|
62 |
|
63 |
|
64 |
-
theme = gr.themes.Default(
|
|
|
|
|
|
|
65 |
with gr.Blocks(theme=theme, css=css, title="SEA.AI Vision Demo") as demo:
|
66 |
badges = gr.HTML(load_badges(flagged_counter.count()))
|
67 |
title = gr.HTML(TITLE)
|
|
|
53 |
def inference(image):
|
54 |
"""Run inference on image and return annotated image."""
|
55 |
results = model(image)
|
56 |
+
return results.draw(image)
|
57 |
|
58 |
# Flagging
|
59 |
dataset_name = "SEA-AI/crowdsourced-sea-images"
|
|
|
61 |
flagged_counter = FlaggedCounter(dataset_name)
|
62 |
|
63 |
|
64 |
+
theme = gr.themes.Default(
|
65 |
+
primary_hue=gr.themes.colors.indigo,
|
66 |
+
font=[gr.themes.GoogleFont("Saira"), gr.themes.GoogleFont("Source Sans Pro")],
|
67 |
+
)
|
68 |
with gr.Blocks(theme=theme, css=css, title="SEA.AI Vision Demo") as demo:
|
69 |
badges = gr.HTML(load_badges(flagged_counter.count()))
|
70 |
title = gr.HTML(TITLE)
|