Conversation
Contributor
|
Hey Eric, overall really good stuff! I left a few comments. |
Ansh-Gandhi
requested changes
Mar 7, 2026
| MODEL_PATH = "checkpoints/best_model.pth" | ||
| THRESHOLD = 0.9 | ||
| OUTPUT_PATH = "results/collage.jpg" | ||
| WINDOW_SIZES = [256, 512] |
Contributor
There was a problem hiding this comment.
Should this window size be 128 x 256?
src/common/voc_dataset.py
Outdated
| def _parse_annotations(self) -> None: | ||
| """Parse all XML annotations and create sample list.""" | ||
| """Parse annotations - only include target class and one negative class.""" | ||
| TARGET_CLASS_IDX = 14 # person |
Contributor
There was a problem hiding this comment.
I am not 100% sure on this but there is a chance the labels may have to be 0 and 1 for the classification due to pytorch expecting that instead.
Collaborator
Author
There was a problem hiding this comment.
This should be okay because I convert to 0/1 labels in the training loop, here for reference:
target-object-localization/src/training.py
Lines 141 to 143 in 1dcfa34
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.
We ran into issues that stemmed from the fact that the model was trained on cropped bounding boxes of the target class but ran inference on full resized images, causing a train/inference mismatch and significant amount of false positives.
Fixed by adding a sliding window approach (128, 256 px). Also noticed potential issues with the data imbalance, so I balanced the training data to just the "target" class + one other class (instead of the full 19 classes), this produces very decent results.