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.
swarms/playground/models/bioclip_example.py

25 lines
589 B

from swarms.models.bioclip import BioClip
clip = BioClip(
"hf-hub:microsoft/BiomedCLIP-PubMedBERT_256-vit_base_patch16_224"
)
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,
}
clip.plot_image_with_metadata("swarms.jpeg", metadata)