generated from ai-cfia/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Performance and Accuracy Testing Script for FertiScan Pipeline #32
Merged
Endlessflow
merged 20 commits into
main
from
18-implement-basic-performance-testing-framework
Oct 16, 2024
Merged
Add Performance and Accuracy Testing Script for FertiScan Pipeline #32
Endlessflow
merged 20 commits into
main
from
18-implement-basic-performance-testing-framework
Oct 16, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit adds a basic devcontainer configuration and implements a simple naive framework for performance testing.
This commit adds a basic devcontainer configuration and implements a simple naive framework for performance testing.
…nd save the result in a csv file
6 tasks
* feat: add a new input field for the form signature for the json_schema * feat: Update max_token value for gpt-4o model The `max_token` value for the `gpt-4o` model in the `gpt.py` file was changed to `None`. This change allows for unlimited token length when making API calls with the `gpt-4o` model. * feat: Update company information in expected.json The company information in the `expected.json` file was updated to reflect the new details of GreenGrow Inc. This change includes the company name, address, website, and phone number. * fix: remove newline at end of file in test_inspection.py * chore: Update test_gpt.py with translated warranty information and nutrient values * feat: Add translated nutrient values for ingredients in expected.json The code changes include adding nutrient values for ingredients in the expected.json file. This enhancement improves the accuracy and completeness of the data. The commit message follows the established convention of using a "feat" prefix to indicate a new feature or enhancement. * feat: Update nutrient values in expected.json The code changes involve updating the nutrient values in the expected.json file. This improves the accuracy and completeness of the data. The commit message follows the established convention of using a "feat" prefix for new features or enhancements. * feat: Update nutrient values in expected.json * refactor: Refactor field validation in inspection.py Refactor the field validation in the `GuaranteedAnalysis` and `FertilizerInspection` classes in `inspection.py`. The `replace_none_with_empty_list` methods have been updated to use the `field_validator` decorator instead of the `model_validator` decorator. This change improves the readability and maintainability of the code.
This commit adds a basic devcontainer configuration and implements a simple naive framework for performance testing.
…one on unit tests
…ator and I have no idea why...
k-allagbe
reviewed
Oct 6, 2024
…classes Simplified the script by replacing classes with functions to reduce complexity and improve readability. The script now: 1. Loads environment variables. 2. Loads test cases (images and expected outputs) from the `test_data` folder. 3. Iterates through the test cases to run the pipeline and assess performance. 4. Compiles the results into a CSV file. Consolidated trivial functions into larger ones with single responsibilities to make the code more maintainable. Updated type hints to use the latest built-in types.
… case handling for missing fields in `calculate_accuracy()`
k-allagbe
reviewed
Oct 10, 2024
model_validator import got lost during the merge conflict resolution
k-allagbe
approved these changes
Oct 16, 2024
Endlessflow
deleted the
18-implement-basic-performance-testing-framework
branch
October 16, 2024 20:23
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a basic performance and accuracy testing framework for the FertiScan pipeline as outlined in Issue #18. The key features include the ability to measure the end-to-end execution time of the pipeline, evaluate accuracy using Levenshtein similarity, and generate structured reports in CSV format.
My apologies @k-allagbe for the long PR. I will try to summarize the most important information bellow.
Key Changes:
TestCase
Class:TestRunner
Class:Accuracy Calculation:
Performance Reporting:
Output Handling: ( I used it for debugging mostly idk if it's pertinent to keep - looking for feedback)
test_outputs
, allowing for a side-by-side comparison with expected output JSON.How to Test:
test_data/labels
folder with images andexpected_output.json
files. (follow structure in the README found in thetest_data/labels
folder).python performance_test
.reports
folder for a CSV report that details test case performance and accuracy.Example CSV Report:
Suggested Next Steps
closes #18