Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,7 +40,7 @@ def fig_to_pil(fig):
|
|
| 40 |
return Image.open(buf)
|
| 41 |
|
| 42 |
@spaces.GPU
|
| 43 |
-
def run_example(task_prompt, image, text_input=None, model_id='
|
| 44 |
model = models[model_id]
|
| 45 |
processor = processors[model_id]
|
| 46 |
if text_input is None:
|
|
@@ -145,7 +145,7 @@ with gr.Blocks(theme="sudeepshouche/minimalist") as demo:
|
|
| 145 |
with gr.Row():
|
| 146 |
with gr.Column():
|
| 147 |
input_img = gr.Image(label="Input Picture")
|
| 148 |
-
model_selector = gr.Dropdown(choices=list(models.keys()), label="Model", value='
|
| 149 |
task_prompt = gr.Dropdown(choices=single_task_list, label="Task Prompt", value="Object Detection")
|
| 150 |
text_input = gr.Textbox(label="Text Input", placeholder="Not used for Florence-2 Object Detection")
|
| 151 |
submit_btn = gr.Button(value="Submit")
|
|
@@ -161,8 +161,6 @@ with gr.Blocks(theme="sudeepshouche/minimalist") as demo:
|
|
| 161 |
["examples/bccd-test/BloodImage_00090_jpg.rf.7e3d419774b20ef93d4ec6c4be8f64df.jpg", 'Object Detection'],
|
| 162 |
["examples/bccd-test/BloodImage_00099_jpg.rf.0a65e56401cdd71253e7bc04917c3558.jpg", 'Object Detection'],
|
| 163 |
["examples/bccd-test/BloodImage_00112_jpg.rf.6b8d185de08e65c6d765c824bb76ec68.jpg", 'Object Detection'],
|
| 164 |
-
["examples/bccd-test/BloodImage_00113_jpg.rf.ab69dfaa52c1b3249cf44fa66afbb619.jpg", 'Object Detection'],
|
| 165 |
-
["examples/bccd-test/BloodImage_00120_jpg.rf.4a2f84ca3564ef453b12ceb9c852e32e.jpg", 'Object Detection'],
|
| 166 |
["examples/liver-test/15_239_101_64_47_jpg.rf.c23cc3f6ba46896ce9c2cf3ee242bbaf.jpg", 'Object Detection'],
|
| 167 |
["examples/liver-test/15_239_101_65_47_jpg.rf.ab1f2fbab25cf803c9f59cccc594848c.jpg", 'Object Detection'],
|
| 168 |
["examples/liver-test/15_239_203_35_22_jpg.rf.408ffd5311f8d90f5db8f5913e876dc9.jpg", 'Object Detection'],
|
|
|
|
| 40 |
return Image.open(buf)
|
| 41 |
|
| 42 |
@spaces.GPU
|
| 43 |
+
def run_example(task_prompt, image, text_input=None, model_id='dwb2023/florence2-large-bccd-base-ft'):
|
| 44 |
model = models[model_id]
|
| 45 |
processor = processors[model_id]
|
| 46 |
if text_input is None:
|
|
|
|
| 145 |
with gr.Row():
|
| 146 |
with gr.Column():
|
| 147 |
input_img = gr.Image(label="Input Picture")
|
| 148 |
+
model_selector = gr.Dropdown(choices=list(models.keys()), label="Model", value='dwb2023/florence2-large-bccd-base-ft')
|
| 149 |
task_prompt = gr.Dropdown(choices=single_task_list, label="Task Prompt", value="Object Detection")
|
| 150 |
text_input = gr.Textbox(label="Text Input", placeholder="Not used for Florence-2 Object Detection")
|
| 151 |
submit_btn = gr.Button(value="Submit")
|
|
|
|
| 161 |
["examples/bccd-test/BloodImage_00090_jpg.rf.7e3d419774b20ef93d4ec6c4be8f64df.jpg", 'Object Detection'],
|
| 162 |
["examples/bccd-test/BloodImage_00099_jpg.rf.0a65e56401cdd71253e7bc04917c3558.jpg", 'Object Detection'],
|
| 163 |
["examples/bccd-test/BloodImage_00112_jpg.rf.6b8d185de08e65c6d765c824bb76ec68.jpg", 'Object Detection'],
|
|
|
|
|
|
|
| 164 |
["examples/liver-test/15_239_101_64_47_jpg.rf.c23cc3f6ba46896ce9c2cf3ee242bbaf.jpg", 'Object Detection'],
|
| 165 |
["examples/liver-test/15_239_101_65_47_jpg.rf.ab1f2fbab25cf803c9f59cccc594848c.jpg", 'Object Detection'],
|
| 166 |
["examples/liver-test/15_239_203_35_22_jpg.rf.408ffd5311f8d90f5db8f5913e876dc9.jpg", 'Object Detection'],
|