目录

PCT_jittor

A Jittor implementation of Point Cloud Transformer (PCT) for ModelNet40 classification in the Jittor competition assignment.

Project Overview

This project trains a PCT classifier on ModelNet40 point clouds and exports test predictions in the required result.json format. The repository keeps only code and documentation needed for reproduction; datasets, checkpoints, reports, and generated results are intentionally excluded from version control.

Project Structure

PCT_jittor/
|-- pct.py
|-- data/
|   `-- README.md
|-- .gitignore
|-- LICENSE
`-- README.md

Local files not tracked by git may include:

  • data/train_points.npy
  • data/train_labels.npy
  • data/test_points.npy
  • data/categories.txt
  • pct_model.pkl
  • result.json
  • REPORT.pdf

Environment Setup

Recommended environment: WSL2 Ubuntu 24.04 + Miniconda + Jittor.

Python version:

  • Python 3.9

Example setup:

conda create -n jittor python=3.9 -y
conda activate jittor
pip install --upgrade pip setuptools wheel
pip install "numpy<2" jittor
sudo apt update
sudo apt install -y gcc-12 g++-12
export cc_path=/usr/bin/g++-12
export CC=/usr/bin/gcc-12
export CXX=/usr/bin/g++-12

If you use CUDA in WSL, make sure Jittor CUDA compilation tests pass before training.

Data Preparation

Place the dataset files under data/:

data/
|-- categories.txt
|-- train_points.npy
|-- train_labels.npy
`-- test_points.npy

The script also supports the older data/data/ layout, but the current repository uses data/.

Training

Run training from the project root:

python pct.py --data_dir ./data --epochs 200 --batch_size 32 --seed 42

Important arguments:

  • --data_dir: dataset root directory
  • --epochs: training epochs
  • --batch_size: batch size
  • --lr: initial learning rate
  • --seed: random seed for reproducibility
  • --model_path: output checkpoint path
  • --result_path: output prediction json path

Evaluation / Inference

The script trains the model, saves pct_model.pkl, and then predicts labels for the test set automatically:

python pct.py --data_dir ./data --model_path pct_model.pkl --result_path result.json

Output files:

  • pct_model.pkl: trained checkpoint
  • result.json: test-set prediction dictionary, mapping sample index to predicted class id

Method Summary

This implementation includes:

  • ModelNet40Dataset for loading and random point sampling
  • training-time data augmentation with random Y-axis rotation, scaling, and jitter
  • SA_Layer self-attention block with Query, Key, and Value projection
  • PCT classification backbone
  • SGD optimizer with cosine annealing learning-rate scheduling

Result Notes

Training metrics printed by pct.py are training loss and training accuracy. Final online evaluation scores may differ from local runs because the official score is computed on the hidden test-set labels after submission.

Reproducibility

This project provides:

  • command-line arguments for all important hyperparameters
  • --seed to control randomness
  • clear dataset layout requirements
  • a one-command training and inference entry point

License

This repository is released under the MIT License.

关于

A Jittor implementation of Point Cloud Transformer(PCT) for ModelNet40 classification

32.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802032778号