Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@amadeuszsz
Copy link
Collaborator

@amadeuszsz amadeuszsz commented Dec 8, 2025

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

  • Log
[2025-12-23 18:48:46,302 INFO test.py line 243 3661] Test: 1512095ff0c4e38b42ef64723ca717ed [750/750]-278195 Batch 3.565 (3.502) Accuracy 0.9247 (0.6239) mIoU 0.5597 (0.5742)                                                                                                     
[2025-12-23 18:48:46,343 INFO test.py line 260 3661] Syncing ...                                                                                                                                                                                                                   
[2025-12-23 18:48:46,344 INFO test.py line 286 3661] Val result: mIoU/mAcc/allAcc 0.5742/0.6239/0.9549                                                                                                                                                                             
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_0 - drivable_surface Result: iou/accuracy 0.9627/0.9847                                                                                                                                                                 
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_1 - other_flat_surface Result: iou/accuracy 0.6352/0.7792                                                                                                                                                               
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_2 - sidewalk Result: iou/accuracy 0.8517/0.9063                                                                                                                                                                         
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_3 - manmade Result: iou/accuracy 0.9259/0.9555                                                                                                                                                                          
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_4 - vegetation Result: iou/accuracy 0.9135/0.9637                                                                                                                                                                       
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_5 - car Result: iou/accuracy 0.9481/0.9636                                                                                                                                                                              
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_6 - bus Result: iou/accuracy 0.9490/0.9842                                                                                                                                                                              
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_7 - emergency_vehicle Result: iou/accuracy 0.9703/0.9850                                                                                                                                                                
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_8 - train Result: iou/accuracy 0.0000/0.0000                                                                                                                                                                            
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_9 - truck Result: iou/accuracy 0.9466/0.9609                                                                                                                                                                            
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_10 - tractor_unit Result: iou/accuracy 0.9218/0.9742                                                                                                                                                                    
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_11 - semi_trailer Result: iou/accuracy 0.8820/0.9434                                                                                                                                                                    
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_12 - construction_vehicle Result: iou/accuracy 0.8787/0.8911                                                                                                                                                            
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_13 - forklift Result: iou/accuracy 0.0181/0.0239                                                                                                                                                                        
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_14 - kart Result: iou/accuracy 0.0000/0.0000                                                                                                                                                                            
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_15 - motorcycle Result: iou/accuracy 0.7497/0.7626                                                                                                                                                                      
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_16 - bicycle Result: iou/accuracy 0.7354/0.7882                                                                                                                                                                         
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_17 - pedestrian Result: iou/accuracy 0.8452/0.8828                                                                                                                                                                      
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_18 - personal_mobility Result: iou/accuracy 0.0000/0.0000                                                                                                                                                               
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_19 - animal Result: iou/accuracy 0.0000/0.0000                                                                                                                                                                          
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_20 - pushable_pullable Result: iou/accuracy 0.2776/0.4690                                                                                                                                                               
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_21 - traffic_cone Result: iou/accuracy 0.5583/0.6697                                                                                                                                                                    
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_22 - stroller Result: iou/accuracy 0.1143/0.1535                                                                                                                                                                        
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_23 - debris Result: iou/accuracy 0.0000/0.0000                                                                                                                                                                          
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_24 - other_stuff Result: iou/accuracy 0.6637/0.7990                                                                                                                                                                     
[2025-12-23 18:48:46,344 INFO test.py line 289 3661] Class_25 - noise+ghost_point Result: iou/accuracy 0.1818/0.3803                                                                                                                                                               
[2025-12-23 18:48:46,344 INFO test.py line 297 3661] <<<<<<<<<<<<<<<<< End Evaluation <<<<<<<<<<<<<<<<< 

Signed-off-by: Amadeusz Szymko <[email protected]>
@amadeuszsz amadeuszsz self-assigned this Dec 8, 2025
@amadeuszsz amadeuszsz marked this pull request as ready for review December 24, 2025 01:35
Copy link
Contributor

Copilot AI left a 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.

Copy link
Collaborator

@KSeangTan KSeangTan left a 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

@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):
Copy link
Collaborator

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, addressed in adbd4ba

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")
Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, addressed in 465ba61

data_list.extend(info["data_list"])
return data_list

def map_segments(self, segment, lidarseg_categories):
Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, addressed in be80492 and 0b1f565

self.test_last = test_last

def after_train(self):
from engines.test import TESTERS
Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, addressed in 7379585


# Load coordinates from saved result file
if logger:
print(f"Loading coordinates from {result_path}")
Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, addressed in 0b1f565

logger.info(f"Save Lines to: {file_path}")


def get_segmentation_colors(labels, result_path, class_colors, logger=None):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typing

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, addressed in be80492 and 0b1f565

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):
Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, addressed in 0b1f565

@amadeuszsz amadeuszsz requested a review from KSeangTan December 25, 2025 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants