Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix RandomWeightedCrop for Integer Weightmap Handling (#8097)
Fixes #7949 . ### Description Regardless of the type of `weight map`, random numbers should be kept as floating-point numbers for calculating the sampling location. However, `searchsorted` requires matching data structures. I have modified `convert_to_dst_type` to control converting only the data structure while maintaining the original data type. Additionally, I have included an example with integer weight maps in the test file. ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. --------- Signed-off-by: Han123su <popsmall212@gmail.com> Signed-off-by: Han123su <107395380+Han123su@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information