-
Notifications
You must be signed in to change notification settings - Fork 19
feat(PTv3): enable t4dataset #148
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Amadeusz Szymko <[email protected]>
Signed-off-by: Amadeusz Szymko <[email protected]>
Signed-off-by: Amadeusz Szymko <[email protected]>
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 overview
This PR integrates T4Dataset support for PTv3 point cloud segmentation, replacing the previous hardcoded class mapping with a flexible configuration-based approach. The changes enable proper handling of T4Dataset-specific label mappings and add visualization capabilities for segmentation results.
Key changes:
- Implemented flexible class mapping system to replace hardcoded label mappings
- Added visualization support for point cloud segmentation results
- Updated dataset paths and configurations for T4Dataset integration
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| projects/PTv3/utils/visualization.py | Replaced file I/O utilities with visualization functions for point cloud segmentation |
| projects/PTv3/utils/misc.py | Added invert_class_mapping utility for reversing class mapping dictionaries |
| projects/PTv3/engines/test.py | Integrated visualization and class mapping inversion into test pipeline |
| projects/PTv3/engines/hooks/misc.py | Removed unsupported weights_only parameter from load_state_dict |
| projects/PTv3/engines/hooks/evaluator.py | Updated to use inverted class mapping for logging |
| projects/PTv3/datasets/t4dataset.py | Refactored to use configurable class mapping and updated data loading paths |
| projects/PTv3/configs/semseg-pt-v3m1-0-t4dataset.py | Added comprehensive T4Dataset class mappings and updated configurations |
| projects/PTv3/configs/semseg-pt-v3m1-0-base.py | Reorganized configuration to use centralized class mapping variables |
| projects/PTv3/configs/base/default_runtime.py | Added visualization-related configuration options |
| projects/PTv3/README.md | Updated example commands with corrected paths and visualization options |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
KSeangTan
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.
LGTM overall, some minor comments
projects/PTv3/datasets/t4dataset.py
Outdated
| @DATASETS.register_module() | ||
| class T4Dataset(DefaultDataset): | ||
| def __init__(self, sweeps=10, ignore_index=-1, **kwargs): | ||
| def __init__(self, sweeps=10, ignore_index=-1, class_mapping={}, **kwargs): |
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.
Are you also training with 10 sweeps?
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.
Thanks, addressed in adbd4ba
projects/PTv3/datasets/t4dataset.py
Outdated
| assert split in ["train", "val", "test"] | ||
| if split == "train": | ||
| return os.path.join(self.data_root, "info", f"t4dataset_xx1_infos_train.pkl") | ||
| return os.path.join(self.data_root, "info", f"t4dataset_j6gen2_lidarseg_infos_train.pkl") |
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.
I dont think we should hardcode it here, better is to configure it in the config
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.
Thanks, addressed in 465ba61
projects/PTv3/datasets/t4dataset.py
Outdated
| data_list.extend(info["data_list"]) | ||
| return data_list | ||
|
|
||
| def map_segments(self, segment, lidarseg_categories): |
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.
Typing for segment and lidarseg_categories
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.
projects/PTv3/engines/hooks/misc.py
Outdated
| self.test_last = test_last | ||
|
|
||
| def after_train(self): | ||
| from engines.test import TESTERS |
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.
Avoid to write import statements in a function
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.
Thanks, addressed in 7379585
projects/PTv3/utils/visualization.py
Outdated
|
|
||
| # Load coordinates from saved result file | ||
| if logger: | ||
| print(f"Loading coordinates from {result_path}") |
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.
If we have a logger, please use logger.info
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.
Thanks, addressed in 0b1f565
projects/PTv3/utils/visualization.py
Outdated
| logger.info(f"Save Lines to: {file_path}") | ||
|
|
||
|
|
||
| def get_segmentation_colors(labels, result_path, class_colors, logger=None): |
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.
Typing
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.
projects/PTv3/utils/visualization.py
Outdated
| x = x.clone().detach().cpu().numpy() | ||
| assert isinstance(x, np.ndarray) | ||
| return x | ||
| def create_colors_from_predictions(predictions, num_points, class_colors, logger=None): |
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.
Can we set logger to mandatory? it's a bit ugly if we need to check if logger every time
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.
Thanks, addressed in 0b1f565
Signed-off-by: Amadeusz Szymko <[email protected]>
Signed-off-by: Amadeusz Szymko <[email protected]>
Signed-off-by: Amadeusz Szymko <[email protected]>
Signed-off-by: Amadeusz Szymko <[email protected]>
Signed-off-by: Amadeusz Szymko <[email protected]>
Summary
T4Dataset integration for lidarseg.
Requires #140.
Note
PTv3 is not part of mmdetection3d, and therefore its implementation in AWML consists of boilerplate code.
Test performed