Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,11 +20,14 @@ subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENT
|
|
| 20 |
models = {
|
| 21 |
'microsoft/Florence-2-large-ft': AutoModelForCausalLM.from_pretrained('microsoft/Florence-2-large-ft', trust_remote_code=True).to("cuda").eval(),
|
| 22 |
'dwb2023/florence2-large-bccd-base-ft': AutoModelForCausalLM.from_pretrained('dwb2023/florence2-large-bccd-base-ft', trust_remote_code=True).to("cuda").eval(),
|
|
|
|
|
|
|
| 23 |
}
|
| 24 |
|
| 25 |
processors = {
|
| 26 |
'microsoft/Florence-2-large-ft': AutoProcessor.from_pretrained('microsoft/Florence-2-large-ft', trust_remote_code=True),
|
| 27 |
-
'dwb2023/florence2-large-bccd-base-ft': AutoProcessor.from_pretrained('microsoft/Florence-2-large-ft', trust_remote_code=True),
|
|
|
|
| 28 |
}
|
| 29 |
|
| 30 |
colormap = ['blue','orange','green','purple','brown','pink','gray','olive','cyan','red',
|
|
@@ -160,6 +163,10 @@ with gr.Blocks(theme="sudeepshouche/minimalist") as demo:
|
|
| 160 |
["examples/bccd-test/BloodImage_00112_jpg.rf.6b8d185de08e65c6d765c824bb76ec68.jpg", 'Object Detection'],
|
| 161 |
["examples/bccd-test/BloodImage_00113_jpg.rf.ab69dfaa52c1b3249cf44fa66afbb619.jpg", 'Object Detection'],
|
| 162 |
["examples/bccd-test/BloodImage_00120_jpg.rf.4a2f84ca3564ef453b12ceb9c852e32e.jpg", 'Object Detection'],
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
],
|
| 164 |
|
| 165 |
inputs=[input_img, task_prompt],
|
|
|
|
| 20 |
models = {
|
| 21 |
'microsoft/Florence-2-large-ft': AutoModelForCausalLM.from_pretrained('microsoft/Florence-2-large-ft', trust_remote_code=True).to("cuda").eval(),
|
| 22 |
'dwb2023/florence2-large-bccd-base-ft': AutoModelForCausalLM.from_pretrained('dwb2023/florence2-large-bccd-base-ft', trust_remote_code=True).to("cuda").eval(),
|
| 23 |
+
'dwb2023/florence2-large-liver-disease-ft': AutoModelForCausalLM.from_pretrained('dwb2023/florence2-large-liver-disease-ft', trust_remote_code=True).to("cuda").eval(),
|
| 24 |
+
|
| 25 |
}
|
| 26 |
|
| 27 |
processors = {
|
| 28 |
'microsoft/Florence-2-large-ft': AutoProcessor.from_pretrained('microsoft/Florence-2-large-ft', trust_remote_code=True),
|
| 29 |
+
'dwb2023/florence2-large-bccd-base-ft': AutoProcessor.from_pretrained('microsoft/Florence-2-large-ft', trust_remote_code=True),
|
| 30 |
+
'dwb2023/florence2-large-liver-disease-ft': AutoProcessor.from_pretrained('microsoft/Florence-2-large-ft', trust_remote_code=True),
|
| 31 |
}
|
| 32 |
|
| 33 |
colormap = ['blue','orange','green','purple','brown','pink','gray','olive','cyan','red',
|
|
|
|
| 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'],
|
| 169 |
+
["examples/liver-test/15_242_202_12_107_jpg.rf.4d864b8288a54e618e6fa0c327e1445e.jpg", 'Object Detection']
|
| 170 |
],
|
| 171 |
|
| 172 |
inputs=[input_img, task_prompt],
|