fix .gitignore and add data files
Point cloud classification project based on Jittor and a simplified PCT (Point Cloud Transformer) model for the ModelNet40 dataset.
Jittor
PCT (Point Cloud Transformer)
ModelNet40
This project trains a point cloud classifier on ModelNet40 and generates test predictions in result.json.
result.json
The current implementation includes:
.npy
AdamW
PA3/ ├─ data/ │ ├─ categories.txt │ ├─ train_points.npy │ ├─ train_labels.npy │ └─ test_points.npy ├─ pct.py ├─ PA3_README.pdf └─ README.md
This project is currently intended to run in WSL Ubuntu with a CPU-only Jittor environment.
WSL Ubuntu
Reason:
3.10
jittor
numpy
The code expects the following files under ./data:
./data
train_points.npy
train_labels.npy
test_points.npy
categories.txt
Expected shapes:
(N, 2048, 3)
(N,)
(M, 2048, 3)
Recommended command:
wsl -d Ubuntu bash /mnt/c/Users/ChenChong/Desktop/PA3/wsl_run_pct_cpu.sh
Example:
wsl -d Ubuntu bash /mnt/c/Users/ChenChong/Desktop/PA3/wsl_run_pct_cpu.sh --epochs 10 --batch_size 8 --n_points 512 --lr 0.001 --vote_num 3
If your current environment already has a working CPU-only Jittor installation:
python pct.py
The most important command-line arguments are:
--data_dir
--n_points
1024
--batch_size
32
--epochs
200
--lr
0.001
--seed
42
--val_ratio
0.1
--weight_decay
0.05
--label_smoothing
0.2
--vote_num
3
After training, the script produces:
pct_model_best.pkl
pct_model.pkl
Each epoch prints:
Epoch [1/20] Loss: 2.1000 Train Acc: 42.35% Val Loss: 1.9500 Val Acc: 48.20% LR: 0.000994 Time: 620.4s
The most important metric during training is Val Acc.
Val Acc
os.environ["nvcc_path"] = ""
jt.flags.use_cuda = 0
n_points
If you want faster iteration, try:
wsl -d Ubuntu bash /mnt/c/Users/ChenChong/Desktop/PA3/wsl_run_pct_cpu.sh --epochs 10 --batch_size 8 --n_points 512
If you want to push accuracy further, try:
epochs
Train Acc
vote_num
Recommended project URL identifier:
modelnet40-pct-classification
A Jittor implementation of Point Cloud Transformer(PCT) for ModelNet40 classification
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
modelnet40-pct-classification
Point cloud classification project based on
Jittorand a simplifiedPCT (Point Cloud Transformer)model for theModelNet40dataset.Overview
This project trains a point cloud classifier on
ModelNet40and generates test predictions inresult.json.The current implementation includes:
.npypoint cloud filesAdamWoptimizerProject Structure
Environment
Recommended
This project is currently intended to run in
WSL Ubuntuwith a CPU-onlyJittorenvironment.Reason:
Jittorimport/compile was not stable on this machineMain Dependencies
3.10jittornumpyData Format
The code expects the following files under
./data:train_points.npytrain_labels.npytest_points.npycategories.txtExpected shapes:
train_points.npy:(N, 2048, 3)train_labels.npy:(N,)test_points.npy:(M, 2048, 3)How to Run
Run in WSL
Recommended command:
Run with Custom Arguments
Example:
Direct Python Run
If your current environment already has a working CPU-only
Jittorinstallation:Main Arguments
The most important command-line arguments are:
--data_dir: dataset directory, default./data--n_points: number of sampled points per shape, default1024--batch_size: batch size, default32--epochs: number of training epochs, default200--lr: learning rate, default0.001--seed: random seed, default42--val_ratio: validation split ratio, default0.1--weight_decay: AdamW weight decay, default0.05--label_smoothing: label smoothing factor, default0.2--vote_num: number of test-time votes, default3Outputs
After training, the script produces:
pct_model_best.pkl: best model selected by validation accuracypct_model.pkl: final loaded model used for predictionresult.json: test set predictionsTraining Logs
Each epoch prints:
Example:
The most important metric during training is
Val Acc.Notes
os.environ["nvcc_path"] = ""before importingJittor.jt.flags.use_cuda = 0.n_pointsand many epochs.Suggested Experiments
If you want faster iteration, try:
If you want to push accuracy further, try:
epochsn_pointsreasonably highVal Accinstead of onlyTrain Accvote_numvaluesRepository Tip
Recommended project URL identifier: