Skip to content

Fix issues #609, #649 and correct RandLA-Net preprocessing#680

Open
lkpopo wants to merge 1 commit intoisl-org:mainfrom
lkpopo:main
Open

Fix issues #609, #649 and correct RandLA-Net preprocessing#680
lkpopo wants to merge 1 commit intoisl-org:mainfrom
lkpopo:main

Conversation

@lkpopo
Copy link
Copy Markdown

@lkpopo lkpopo commented Aug 28, 2025

Summary

This PR fixes the following issues and improves data preprocessing:

  1. Issues TypeError: unhashable type: 'numpy.ndarray' when saving test results with Custom3D dataset #609, Summarize the question. (e.g., "How to do inference on custom dataset ? ") #649:

    • Adjusted log printing positions.
    • Corrected data type conversions.
  2. RandLA-Net preprocessing:

    • Applied the intended data augmentation that was missing.
    • Fixed precision issues for large point coordinates by converting to float64 before processing, then back to float32.

Notes

  • No changes to model architecture.
  • Only fixes bugs and improves preprocessing reliability.

…org#649)

- Correct RandLA-Net preprocessing: apply augmentation and convert large coordinates safely
@ssheorey ssheorey requested a review from Copilot February 22, 2026 04:39
Copy link
Copy Markdown

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 addresses issues #609 and #649 while fixing critical bugs in RandLA-Net preprocessing. The changes focus on fixing log statement placement, correcting data type handling, and ensuring augmentation results are properly captured.

Changes:

  • Moved test accuracy logging inside the batch loop for proper metrics display
  • Fixed RandLA-Net to capture augmentation return values that were previously ignored
  • Improved data type handling in prediction label conversion with proper vectorization
  • Added float64 precision handling in data recentering to prevent numerical errors with large coordinates

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
ml3d/torch/pipelines/semantic_segmentation.py Relocated logging statement inside batch loop to display metrics during testing
ml3d/torch/models/randlanet.py Fixed augmentation call to capture returned transformed data
ml3d/datasets/customdataset.py Improved label-to-name conversion with type checking and vectorization
ml3d/datasets/augment/augmentation.py Enhanced numerical precision by using float64 during recentering operations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

data_float64 = data.astype(np.float64)
mean_vals = data_float64[:, dim].mean(0)
data_float64[:, dim] -= mean_vals

Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

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

Remove trailing whitespace on this empty line to maintain consistent code formatting.

Suggested change

Copilot uses AI. Check for mistakes.
pred = results['predict_labels']
pred = np.array(self.label_to_names[pred])
if isinstance(pred, np.ndarray):
pred_names = np.vectorize(lambda x: self.label_to_names[int(x)])(pred)
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

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

Using np.vectorize with a lambda function is inefficient for large arrays as it's essentially a Python loop. Consider using array indexing directly with pred_names = np.array([self.label_to_names[int(x)] for x in pred]) or converting label_to_names to a numpy array and using advanced indexing like np.array(self.label_to_names)[pred.astype(int)].

Suggested change
pred_names = np.vectorize(lambda x: self.label_to_names[int(x)])(pred)
flat_pred = pred.ravel()
pred_names = np.array(
[self.label_to_names[int(x)] for x in flat_pred]
).reshape(pred.shape)

Copilot uses AI. Check for mistakes.
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