Compare Models
You can compare two or more models on multiple images using the compare
function.
This function is ideal if you want to evaluate how different models perform on a single image or multiple images.
The following example shows how to compare OWLv2 and Grounding DINO on a single image:
from autodistill_grounding_dino import GroundingDINO
from autodistill_owlv2 import OWLv2
from autodistill.detection import CaptionOntology
from autodistill.utils import compare
ontology = CaptionOntology(
{
"solar panel": "solar panel",
}
)
models = [
GroundingDINO(ontology=ontology),
OWLv2(ontology=ontology),
]
images = [
"./solar.jpg"
]
compare(
models=models,
images=images
)
Here are the results:
Above, we can see predictions from Grounding DINO and OWLv2.
Code Reference¶
Compare the predictions of multiple models on multiple images.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
models |
list
|
The models to compare |
required |
images |
List[str]
|
The images to compare |
required |
Returns:
Type | Description |
---|---|
A grid of images with the predictions of each model on each image. |
Source code in autodistill/utils.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
|