-
-
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
Add random and foreground oversampling in ROIDataset
#83
Conversation
… and optimize the foreground sample selection logic
ROIDataset
|
Maybe make it modular, don't integrate into the existing code. |
|
You mean leave this part in the |
|
#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
|
Can we replace |
|
@ATATC What about now |
ATATC
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Status Update
Thank you for your contribution to Project Neura and its related projects. We sincerely appreciate your interest in our work and your passion to enhance the community. Your feedback is deeply valuable to us.
This update means one or more of our team members have carefully reviewed the issue you addressed and the corresponding pull request you proposed. The status of your pull request is now changed to:
- The suggestion/problem you raised has been investigated and determined to be non-existent or negligible
- The suggestion/problem you raised has been noticed and verified
- The corresponding solution/fix you proposed has been carefully evaluated, yet we have to reject it regretfully
- The corresponding solution/fix you proposed has been carefully evaluated, yet pending changes before acceptance
- The corresponding solution/fix you proposed has been carefully evaluated and will be merged shortly
Reasons behind This Decision
Just one place needs to change.
What to Expect Next
Will merge after the line separator is removed.
ATATC
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Status Update
Thank you for your contribution to Project Neura and its related projects. We sincerely appreciate your interest in our work and your passion to enhance the community. Your feedback is deeply valuable to us.
This update means one or more of our team members have carefully reviewed the issue you addressed and the corresponding pull request you proposed. The status of your pull request is now changed to:
- The suggestion/problem you raised has been investigated and determined to be non-existent or negligible
- The suggestion/problem you raised has been noticed and verified
- The corresponding solution/fix you proposed has been carefully evaluated, yet we have to reject it regretfully
- The corresponding solution/fix you proposed has been carefully evaluated, yet pending changes before acceptance
- The corresponding solution/fix you proposed has been carefully evaluated and will be merged shortly
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