feat: add ObjectMinPointsFilter transform to drop sparse GT boxes - #135
Open
simonschlaepfer wants to merge 8 commits into
Open
simonschlaepfer wants to merge 8 commits into
simonschlaepfer wants to merge 8 commits into
Conversation
simonschlaepfer
force-pushed
the
feat/object-min-points-filter
branch
3 times, most recently
from
July 7, 2026 15:44
99d5d02 to
b00b94d
Compare
- Extract _BoxFilterTransform base so RangeFilter3D and ObjectMinPointsFilter share the rebuild-boxes + sync-labels logic in one place instead of duplicating it. - ObjectMinPointsFilter: short-circuit min_points == 0 (skip the point-in-box computation entirely) and return a fresh inputs dict in the pair path to match RangeFilter3D (no aliasing of the caller's dict). - Add mixed-dtype and inputs-dict-aliasing regression tests. Assisted-by: Claude Code (Opus 4.8) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
simonschlaepfer
force-pushed
the
feat/object-min-points-filter
branch
from
July 8, 2026 07:14
b00b94d to
bfb343a
Compare
simonschlaepfer
marked this pull request as ready for review
July 8, 2026 07:28
yeetypete
reviewed
Jul 10, 2026
yeetypete
left a comment
Owner
There was a problem hiding this comment.
Just some comments. Biggest issue is caused by me not using pytree in RangeFilter3D.
This branch has not been deployed
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.
Summary
ObjectMinPointsFilter, a transform that drops ground-truth boxes enclosing fewer thanmin_pointsLiDAR points, filteringlabelsin sync. Motivation: boxes with too few points carry little geometric evidence, so training against them mostly injects noise. This is the analog of mmdetection3d'sfilter_by_min_pointsground-truth-database option, exposed as a composable pipeline transform.min_points: int: a box survives iff its interior point count is>= min_points(strictly-less-than is dropped).0keeps every box;1keeps every box with at least one point.PointCloud3Dand every other sample entry pass through unchanged. FollowsRangeFilter3D's dict-based convention: accepts both a single sample dict and an(inputs, targets)pair.pointsentry → no box has a defined count, so all boxes are kept; a present-but-empty point cloud counts as zero points per box (dropped unlessmin_points=0).ObjectPointsSample(feat: add ObjectPointsSample transform for per-object point thinning #133): after that transform simulates sparse returns by thinning each object to a targetkeepcount, applying this filter with a matchingmin_pointsdrops the objects sparse simulation pushed below the detectability floor. The two stay orthogonal — thresholds are matched by the user, nothing couples them automatically.points_in_boxes_3dop (per-box counts are a sum over the[N, M]membership mask), so no new functional kernel was introduced.Test plan
pytest test/test_transforms_object_min_points_filter.py(40 tests: threshold boundary from both sides (min_points0/1/2/99 over known per-box counts); overlap point counted for each box; box type/format preservation; format-agnostic across all four box formats; points and unrelated entries pass through unchanged; single-dict vs(inputs, targets)structure; absent-points keep-all vs empty-cloud drop-all; missingboxes/labelskeys; empty boxes;min_pointsvalidation for negative/non-int/bool)ruff checkandruff format --checkcleanpyrefly checkclean (0 errors)