You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
589 B
25 lines
589 B
1 year ago
|
from swarms.models.bioclip import BioClip
|
||
|
|
||
1 year ago
|
clip = BioClip(
|
||
|
"hf-hub:microsoft/BiomedCLIP-PubMedBERT_256-vit_base_patch16_224"
|
||
|
)
|
||
1 year ago
|
|
||
|
labels = [
|
||
|
"adenocarcinoma histopathology",
|
||
|
"brain MRI",
|
||
|
"covid line chart",
|
||
|
"squamous cell carcinoma histopathology",
|
||
|
"immunohistochemistry histopathology",
|
||
|
"bone X-ray",
|
||
|
"chest X-ray",
|
||
|
"pie chart",
|
||
|
"hematoxylin and eosin histopathology",
|
||
|
]
|
||
|
|
||
|
result = clip("swarms.jpeg", labels)
|
||
1 year ago
|
metadata = {
|
||
|
"filename": "images/.jpg".split("/")[-1],
|
||
|
"top_probs": result,
|
||
|
}
|
||
1 year ago
|
clip.plot_image_with_metadata("swarms.jpeg", metadata)
|