implement a pytest focused on model accuracy for the LicensePlateBenchmark class. The test should use known license plate numbers as the source of truth for evaluating the models for their license plate reading capabilities. The test should be implemented in a new file called test_license_plate_accuracy.py.
The test case should validate the accuracy of the default license plate images under data/images in the project llava-benchmark directory.
Tasks:
Create a new test file test_license_plate_accuracy.py.
In this file, import the necessary modules and classes, including pytest, LicensePlateBenchmark, and Ollama.
Define a dictionary known_license_plates with image file names as keys and corresponding known license plate numbers as values.
Write a test function test_license_plate_accuracy() that does the following:
Mocks the Ollama.run_benchmark() method to return known license plate numbers.
Simulates storing the results for each model, prompt, and image.
Checks that the license plate numbers were stored correctly.
Ensure the accuracy of the Ollama read license plate using the AI model matches the known_license_plate data.
Additional Information:
Here is the structure of the known_license_plates dictionary:
implement a pytest focused on model accuracy for the LicensePlateBenchmark class. The test should use known license plate numbers as the source of truth for evaluating the models for their license plate reading capabilities. The test should be implemented in a new file called
test_license_plate_accuracy.py
.The test case should validate the accuracy of the default license plate images under
data/images
in the projectllava-benchmark
directory.Tasks:
test_license_plate_accuracy.py
.pytest
,LicensePlateBenchmark
, andOllama
.known_license_plates
with image file names as keys and corresponding known license plate numbers as values.test_license_plate_accuracy()
that does the following:Ollama.run_benchmark()
method to return known license plate numbers.known_license_plate
data.Additional Information: Here is the structure of the
known_license_plates
dictionary: