README.md

October 24, 2025 ยท View on GitHub

Setup

We implement this repo with the following environment:

  • Python 3.8
  • Pytorch 1.9.0
  • CUDA 11.3

Install the other package via:

pip install -r requirement.txt

Data Download and Preprocess

Dataset

The MVTec-3D AD dataset can be download from the Official Website. After download, put the dataset in dataset folder.

Checkpoints

The following table lists the pretrain model used in LSFA:

BackbonePretrain Method
Point TransformerPoint-MAE
Point TransformerPoint-Bert
ViT-b/8DINO
ViT-b/8Supervised ImageNet 1K
ViT-b/8Supervised ImageNet 21K
ViT-s/8DINO

Put the checkpoint files in checkpoints folder.

The finetuned weight can be obtained with code in "https://drive.google.com/file/d/1__3FcraLPhmDt9Fj5wcFOvR44rVRdQHR/view?usp=sharing".

1.Extract features for adaptation

cd FeatureExtract bash pretrain_both.sh

2.Train and Test

The extracted point cloud features and RGB features should be placed at './dataset/mvtec3d_preprocessed' Then run the following instruction to adapt the features and save the adaptors:

cd Adaptation

python3 fusion_pretrain.py --accum_iter 16 --lr 0.0003 --batch_size 8 --output_dir ./ssl_outputv2 --classname 0

3.Run patchcore with adapted features

Use weight from the former step for patchcore:

cd PatchCore

python3 main.py --method_name DINO+Point_MAE --memory_bank multiple --rgb_backbone_name vit_base_patch8_224_dino --xyz_backbone_name Point_MAE --classname 0 --weightpath [saved_weight]

Thanks

Our repo is built on 3D-ADS, MoCo-v3 and M3DM, thanks their extraordinary works!