weather detector refactor - #1319
Conversation
|
FYI. There is a merge conflict here. |
d25b9c9 to
e6d9d70
Compare
|
Can you rebase? We recently added new test infra which we will need to add tests for this to. I just pushed the PLZA test skeleton to master. Once you rebase, you'll be able to add tests for this weather detector. Basically you'll want to add the weather detector test here: https://github.com/PokemonAutomation/Arduino-Source/blob/main/SerialPrograms/Source/PokemonLZA/PokemonLZA_Tests.cpp#L17 Here is an example of what the new test structure looks like: https://github.com/PokemonAutomation/Arduino-Source/blob/main/SerialPrograms/Source/PokemonLZA/Inference/PokemonLZA_DialogDetector.cpp#L477-L518 So you'll need to make that, then list the 30-some test files that you merged to the CommandLineTests repo. That way these can be automatically run with the rest of the other tests. |
e6d9d70 to
f5afb33
Compare
I've completed this now. I also made some changes to naming of the weather map screenshots. |
|
Tests are failing. Maybe try rebasing onto main. |
63dbe67 to
cf2066d
Compare
|
I just rebased and tried to test this, but it's failing on missing resources.
|
There is a pending PR on the packages repo that likely needs to be accepted for this to be resolved. |
|
That PR is empty though. Looks like jw wants you to adjust the templates. |
I thought i did that earlier this week. Not sure what happened to the commit. I'll fix it in the morning. |
cf2066d to
4f81ad0
Compare
|
I merged+pulled the new resourced, then rebased this PR. I fixed a few places in the test where you called Of the 36 tests, 24 are passing, 12 are failing because the detector detected either no weather icon, or it detected multiple of them.
Examples: So we're getting close! |
I made some changes to the code by running stuff through the test program. and i bet, since i was calling the wrong test function in the tests, those changes were bad. Ill go rework it. |
4f81ad0 to
b9c3596
Compare
479680c to
4f81ad0
Compare
Refactored the weather detector to use waterfill instead of direct object comparison.
added new testing infrastructure and made some improvements to RMSDs of the weather detector based on the results of the new testing infrastructure.
4f81ad0 to
c792b52
Compare
This pull request refactors and improves the weather icon detection logic for Pokémon LZA. The main change is a switch from a hard-coded template info table to using waterfill template matching. This should improve robustness. The test program is also updated to exercise and debug the new detection logic.
Weather Icon Detection Refactor and Improvements:
WeatherTemplateInfotable and related logic with a matcher-based approach usingWaterfillTemplateMatcherand a newWeatherFullMatcherclass, allowing for more flexible and robust template matching for each weather type.supplemental_template_checksto handle additional region-of-interest template checks for specific weather types, improving detection accuracy and making it easier to add or modify checks.WeatherIconDetectorclass to use the new matcher-based approach, removing unnecessary members and simplifying overlay logic.Test Program and Integration Updates:
Updated the test program (
TestProgramSwitch.cpp) to include the new weather detector and added a debug routine for visualizing and testing weather icon detection. [Code Cleanup:
Removed unused includes and the obsolete
WeatherTemplateInfostruct from headers, reflecting the new detection approach.