目录

PCT_jittor

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

Files

  • pct.py: training and prediction script.
  • train_points.npy: training point clouds, shape (M, N, 3) or compatible.
  • train_labels.npy: training labels, shape (M,).
  • test_points.npy: test point clouds, shape (T, N, 3) or compatible.
  • pct_model.pkl: trained model generated by pct.py.
  • result.json: test prediction result generated by pct.py.

The three .npy data files are expected to be placed in the project root by the competition platform or by the user. If they are placed in ./data, pct.py detects that directory automatically. The script also accepts competition-style aliases such as --data_dir, --batch_size, and --n_points.

Environment

Jittor currently supports Linux and Windows/WSL. For installation, follow the official guide:

https://cg.cs.tsinghua.edu.cn/jittor/download/

Minimal Python dependencies:

pip install jittor numpy

Download the official PA3 ModelNet40 point-cloud data:

./download_data.sh

Usage

Train PCT, save pct_model.pkl, and export result.json:

python3 pct.py

Or use the wrapper script, which detects . or ./data, runs training and prediction, then launches the local verifier:

./run_pa3.sh

Run with common options:

python3 pct.py --epochs 100 --batch-size 32 --num-points 1024 --device cuda

Save periodic checkpoints or resume a long run:

python3 pct.py --epochs 200 --save-every 20
python3 pct.py --resume pct_model_epoch100.pkl --epochs 100

Run prediction with test-time voting:

python3 pct.py --mode predict --votes 10 --model-path pct_model.pkl --result-path result.json

If CUDA is unavailable or incompatible, use CPU mode:

python3 pct.py --device cpu

Only run prediction with an existing model:

python3 pct.py --mode predict --model-path pct_model.pkl --result-path result.json

The output result.json is a JSON dictionary whose keys are test sample indices and whose values are predicted ModelNet40 class IDs. When --votes is greater than 1, later voting passes resample points and apply Y-axis rotation before averaging logits.

Model

The network follows the PA3 requirement:

  • two pointwise Conv1d embedding layers: 3 -> 128 -> 128;
  • four self-attention layers for global point relation modeling;
  • concatenation of the four attention outputs into 512 channels;
  • fusion Conv1d from 512 -> 1024;
  • global max pooling over points;
  • three fully connected classification layers producing 40 logits;
  • cross-entropy loss, SGD optimizer, and cosine annealing learning rate.

Training data augmentation includes random rotation around the Y axis.

Submission Checklist

  • Run python3 pct.py in a supported Jittor environment.
  • Alternatively run ./run_pa3.sh.
  • Confirm pct_model.pkl is generated.
  • Confirm result.json is generated and has one entry per test sample.
  • Run python3 verify_submission.py and resolve every local FAIL.
  • Submit to the Educoder competition page and keep the passing screenshot.
  • Record the Educoder evaluation ID.
  • Create the Gitlink project with a Jittor-related name, description, README, .gitignore, and source code.
  • After creating an empty Gitlink project, push this repository with ./publish_gitlink.sh <gitlink-remote-url>.
  • Add report_assets/educoder_pass.png, report_assets/gitlink_home.png, and a real report_metadata.json.
  • Build the report with python3 build_report.py, or fill the report template and export it as REPORT.pdf. Optional report dependencies are listed in requirements-report.txt.
  • Run python3 check_report_inputs.py to check the report source artifacts.
  • Run python3 audit_pa3_submission.py for a requirement-by-requirement audit against the PA3 handout.
  • The same checks are available as make verify, make report-check, make audit, make final-check, and their *-late variants.
  • See PLATFORM_SUBMISSION_STEPS.md for the exact Educoder, Gitlink, and report artifact handoff.
  • See ARTIFACTS.md for hashes of generated local artifacts.
  • If submitting late, run ./package_late_submission.sh after pct.py, pct_model.pkl, result.json, and REPORT.pdf are present. Build the late report with python3 build_report.py --late and audit it with python3 audit_pa3_submission.py --late.
关于

Jittor implementation of PCT for ModelNet40 point cloud classification.

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

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