目录

# ModelNet40 PCT Classification with Jittor

This repository contains a Jittor implementation of a PCT (Point Cloud Transformer) baseline for ModelNet40 point-cloud classification. The model takes 2048 sampled 3D points per object and predicts one of 40 shape classes.

Environment Installation

Tested locally with:

  • Windows 11
  • Python 3.9
  • Jittor 1.3.8.5
  • NVIDIA RTX 4070 Laptop GPU, CUDA enabled by Jittor

Install dependencies:

pip install -r requirements.txt

If using conda, the tested interpreter is:

C:\Users\Lenovo\anaconda3\envs\jittor\python.exe

Data Preparation

Put the competition-provided ModelNet40 point-cloud files under data/:

data/
  train_points.npy   # (9843, 2048, 3)
  train_labels.npy   # (9843,)
  test_points.npy    # (2468, 2048, 3)
  categories.txt     # optional

The .npy files are ignored by git and should not be submitted to the code repository.

Check the data files:

python .\tools\inspect_data.py --data_dir .\data

Training

Recommended Windows laptop command:

python .\pct.py --config .\configs\default.yaml

A PowerShell wrapper is also provided:

.\scripts\train.ps1

configs/default.yaml is loaded by default and is the recommended place to edit training parameters. Command-line arguments can still override config values when needed.

Evaluation / Inference

Generate the submission JSON from a trained checkpoint:

python .\pct.py --config .\configs\default.yaml --mode predict

Or run:

.\scripts\predict.ps1

The output format is a JSON dictionary:

{
  "0": 12,
  "1": 3
}

Keys are test sample ids as strings, values are predicted class ids.

Result Description

The local validation metric is classification accuracy on a held-out split from train_points.npy. The online score may differ because the final submission is evaluated on the hidden labels of test_points.npy.

On this laptop, one epoch with n_points=1024, batch_size=8, and num_workers=0 takes about 93 seconds after Jittor compilation. Full 200-epoch training is expected to take roughly 5 to 6 hours.

Reproducibility

  • Use --seed to set NumPy and Jittor random seeds.
  • Keep generated logs, checkpoints, and submission files under outputs/.
  • outputs/ is ignored by git to avoid committing training artifacts.

Project Structure

modelnet40_pct/
  README.md
  LICENSE
  NOTICE
  requirements.txt
  configs/
    default.yaml
  data/
    README.md
    categories.txt
  outputs/
  scripts/
    train.ps1
    predict.ps1
    quick_check.ps1
  src/
    __init__.py
    pct.py
  tools/
    inspect_data.py
  pct.py
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

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