Repository navigation
feat(dataclass): add t4pack for pointcloud compression - #322
Open
linick-kang wants to merge 12 commits into
Open
linick-kang wants to merge 12 commits into
linick-kang wants to merge 12 commits into
Conversation
…le file Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t exist Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to lossless layout Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nt workers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t4pack pack Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…FEATS Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Description
This PR adds t4pack, a container that stores all
.pcd.binframes of a channel in one zstd-compressed file,data/<CHANNEL>.pack. It also adds at4packCLI that packs, verifies and (optionally) deletes the loose frames.On real T4 LiDAR data at zstd level 19, the pack is ~2.45x smaller than the loose
.pcd.binfiles (2.34x-2.54x per DB). Measured on a 100-scene pilot; about 4,500 scenes have been packed with the same format so far.Loading needs no change in user code: if
data/LIDAR_CONCAT/00000.pcd.binis missing butdata/LIDAR_CONCAT.packexists,LidarPointCloud.from_file()andSegmentationPointCloud.from_file()read the frame from the pack.sample_data.filenamestays the same.Format (t4pack v1)
f4s), so zstd can match the sign/exponent bytes;intensity/ringare stored asu1/i1.u1/i1(e.g. non-integer intensity or-0.0), the channel falls back to all-f4scolumns. Either way, every frame is verified bit-exact against its source before the pack is put in place.0.pcd.bin,10.pcd.binwork correctly.Changes
t4_devkit/common/t4pack.py(new)encode_frame,decode_frame,write_pack, andPackReader, which supportsread_frameandread_frame_by_name.pack_directory: pack, verify, then atomically rename into place.verify_pack: compares frames that still have a.pcd.binbit-exact, and checks that frames whose.pcd.binwas deleted can be decoded.delete_loose_frames: deletes.pcd.binonly after verifying them against the pack, and deletes only the frames it verified.t4_devkit/dataclass/pointcloud.py:.pcd.binloading falls back to the pack when the file does not exist. Existing behavior is unchanged when the file exists.t4_devkit/sanity/reference/ref201.py:REF201now passes if a.pcd.binframe exists as a file or in its pack. Other file types still have to exist on disk.t4_devkit/cli/pack.py(new): thet4packcommand.t4pack pack <DATA_ROOT> [-rv REV] [-l LEVEL] [--overwrite] [--delete-loose]t4pack verify <DATA_ROOT> [-rv REV]pyproject.toml: adds thezstandard>=0.23.0dependency and thet4packscript.5(x, y, z, intensity, ring) is now a named constant,DEFAULT_NUM_PTS_FEATSint4_devkit/common/t4pack.py. It replaces the bare literal in the existingPointCloudMetainfodefault and bothfrom_fileloaders inpointcloud.py, and is used by the new pack functions and CLI. No behavior change.docs/cli/t4pack.mdand a new "Packed Pointcloud" section indocs/schema/data.md. The REF201 description is updated indocs/schema/requirement.md.Safety
The loose
.pcd.binfiles are never deleted unless--delete-looseis passed.--overwriteis refused if the existing pack contains frames whose.pcd.binhas already been deleted, e.g. after an interrupted deletion.--overwrite) and 3 deleters on the same channel at the same time: 0 frames lost in 30 trials, and no temp files left behind.How to review / test
-0.0Notes / known limitations
00000.pcd.bin, ...). For scenes whose files are not named00000..N-1(e.g.0.pcd.bin,-1-01.pcd.bin), the old packs don't match the real names. In that case--delete-looserefuses to delete andverifyreports mismatches, instead of returning wrong frames. Repack these scenes witht4pack pack --overwritebefore deleting.num_pts_featscomes from. It is read fromdata/<CHANNEL>_INFO/*.json(default 5).SIGKILLcan leave a*.<pid>.<random>.tmpfile next to the pack; it has to be removed manually. Normal exits and Ctrl-C clean up.ruff format --checkreports 3 test files that are already unformatted onmainand are not touched by this PR.