Closed rodja closed 1 week ago
@rodja In add_crop
check_if_plant_exists
checks if a detected plant already exists by calculating the distances to all known crops. If yes, the detection confidence is added to the matched crop's confidence.
We should probably make check_if_plant_exists
return None or the matched plant and add the confidence in another function.
If it's a new plant we add it to the list of plants.
_add_crop_prediction
uses the nearest two known crops and a known spacing between crops to calculate where the next crop should be. If the newly detected crop fits into this prediction radius, it gets a confidence boost.
This helps to ignore false crop detections between the rows.
Year. I just tested the current main code with flakefinder. The flakyness is gone!
By using flake-finder pytest extension we can see some flakyness:
After some digging I think it may be caused by not getting over the necessary threshold of plant detections. How does the new
add_crop
behaviour work? I think I'll need a walkthrough or something from @pascalzauberzeug or @angelom93. Especially the_add_crop_prediction
code does not yet make sense to me.