-
-
Notifications
You must be signed in to change notification settings - Fork 2
Add random and foreground oversampling in ROIDataset
#83
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
Open
perctrix
wants to merge
12
commits into
ProjectNeura:main
Choose a base branch
from
perctrix:feature/random-patch-sampling
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add random and foreground oversampling in ROIDataset
#83
perctrix
wants to merge
12
commits into
ProjectNeura:main
from
perctrix:feature/random-patch-sampling
Conversation
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
… and optimize the foreground sample selection logic
ROIDataset
Contributor
|
Maybe make it modular, don't integrate into the existing code. |
Contributor
Author
|
You mean leave this part in the |
Contributor
|
#82 (comment) Make it a child class inheriting from |
- Merged latest changes from main (19 commits) - Fixed save() to use to_dict() for proper JSON serialization - Added Tensor to list conversion in serialization/deserialization - Preserved random patch sampling features
- Merged latest changes from main - Fixed Tensor serialization in save/load methods - Created RandomROIDataset as child class of ROIDataset - Moved all random sampling logic into the subclass - Kept ROIDataset and InspectionAnnotations minimal and clean
Contributor
|
Can we replace |
Contributor
Author
|
@ATATC What about now |
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 pull request introduces enhancements to the region-of-interest (ROI) sampling logic for inspection datasets, focusing on foreground-aware patch selection and more flexible sampling strategies. The changes add foreground sample tracking to annotations, allow random and foreground-guided ROI cropping, and provide configurable oversampling of foreground regions in the
ROIDataset.ROI sampling and annotation improvements:
foreground_samplesattribute to theInspectionAnnotationclass to store sampled foreground pixel locations for each annotation, enabling foreground-guided ROI selection.random_roiandforeground_guided_random_roiinInspectionAnnotationsto support random and foreground-aware ROI cropping, and updatedcrop_roito optionally use these strategies based on new parameters.Inspection and dataset construction enhancements:
inspectfunction to sample and store foreground pixel indices for each annotation, with configurable minimum/maximum samples and percent coverage, improving downstream patch selection.ROIDatasetclass to accept parameters for random patch sampling and foreground oversampling, and updated theloadmethod to use these options for more flexible ROI extraction. [1] [2]fixed #82