Feature/multi bbox predictions#73
Draft
mualicemu wants to merge 11 commits into
Draft
Conversation
…1-to-many list array support
910d1ff to
05ccd7b
Compare
05ccd7b to
9d4b47b
Compare
This file contains hidden or 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
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.
Description
This PR introduces a new execution pathway (
multi_predict) to extract and return independent species classifications for every bounding box detected in an image, bypassing the legacy constraint that flattened all detections into a single prediction.Key Changes
classifier.py: Addedmulti_preprocess()to dynamically generate separate image crops for each detected bounding box within the image.ensemble_prediction_combiner.py: Addedcombine_predictions_for_all_items(), a new 1-to-many combiner loop. Instead of hardcodingdetections[0], it iterates over all bounding boxes, applies geofencing/roll-up rules individually, and retains the physical bounding box[ymin, xmin, ymax, xmax]coordinates in the output dictionary.ensemble.py: Addedmulti_combine()to orchestrate the new zippering logic.multiprocessing.py: Appended a newmulti_predict()method to theSpeciesNetclass. This safely batches the cropped tensors on the GPU and invokes the new combiner.Note: Strict backwards compatibility is maintained. The original
predict()method andcombine_predictions_for_single_itemremain completely untouched for legacy integrations.