{"id":13444017,"url":"https://github.com/torch-points3d/torch-points3d","last_synced_at":"2025-05-14T01:05:19.849Z","repository":{"id":36999302,"uuid":"226315888","full_name":"torch-points3d/torch-points3d","owner":"torch-points3d","description":"Pytorch framework for doing deep learning on point clouds.","archived":false,"fork":false,"pushed_at":"2025-02-03T23:39:56.000Z","size":93881,"stargazers_count":2567,"open_issues_count":90,"forks_count":396,"subscribers_count":52,"default_branch":"master","last_synced_at":"2025-04-03T15:53:11.683Z","etag":null,"topics":["deep-learning","kpconv","minkowskiengine","point-cloud","pointnet","pytorch","s3dis","scannet","segmentation"],"latest_commit_sha":null,"homepage":"https://torch-points3d.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/torch-points3d.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-06T11:33:34.000Z","updated_at":"2025-04-02T16:08:28.000Z","dependencies_parsed_at":"2023-01-17T13:31:09.849Z","dependency_job_id":"69a53a7f-cda9-46a2-a7ba-33c03ccfade5","html_url":"https://github.com/torch-points3d/torch-points3d","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torch-points3d%2Ftorch-points3d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torch-points3d%2Ftorch-points3d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torch-points3d%2Ftorch-points3d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/torch-points3d%2Ftorch-points3d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/torch-points3d","download_url":"https://codeload.github.com/torch-points3d/torch-points3d/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281389,"owners_count":21077423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","kpconv","minkowskiengine","point-cloud","pointnet","pytorch","s3dis","scannet","segmentation"],"created_at":"2024-07-31T03:02:16.753Z","updated_at":"2025-04-10T19:25:08.450Z","avatar_url":"https://github.com/torch-points3d.png","language":"Python","funding_links":[],"categories":["Python","其他_机器视觉"],"sub_categories":["网络服务_其他"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"40%\" src=\"https://raw.githubusercontent.com/nicolas-chaulet/torch-points3d/master/docs/logo.png\" /\u003e\n\u003c/p\u003e\n\n[![PyPI version](https://badge.fury.io/py/torch-points3d.svg)](https://badge.fury.io/py/torch-points3d) [![codecov](https://codecov.io/gh/nicolas-chaulet/torch-points3d/branch/master/graph/badge.svg)](https://codecov.io/gh/nicolas-chaulet/torch-points3d) [![Actions Status](https://github.com/nicolas-chaulet/torch-points3d/workflows/unittest/badge.svg)](https://github.com/nicolas-chaulet/torch-points3d/actions) [![Documentation Status](https://readthedocs.org/projects/torch-points3d/badge/?version=latest)](https://torch-points3d.readthedocs.io/en/latest/?badge=latest) [![slack](https://img.shields.io/badge/slack-tp3d-brightgreen)](https://join.slack.com/t/torchgeometricco/shared_invite/zt-p6br3yuo-BxRoe36OHHLF6jYU8xHtBA)\n\nThis is a framework for running common deep learning models for point cloud analysis tasks against classic benchmark. It heavily relies on [Pytorch Geometric](https://pytorch-geometric.readthedocs.io/en/latest/notes/resources.html) and [Facebook Hydra](https://hydra.cc/).\n\nThe framework allows lean and yet complex model to be built with minimum effort and great reproducibility.\nIt also provide a high level API to democratize deep learning on pointclouds.\nSee our [paper](https://arxiv.org/pdf/2010.04642.pdf) at 3DV for an overview of the framework capacities and benchmarks of state-of-the-art networks.\n\n# Overview\n\n## Requirements\n\n- CUDA 10 or higher (if you want GPU version)\n- Python 3.7 or higher + headers (python-dev)\n- PyTorch 1.8.1 or higher (PyTorch \u003e= 1.9 is recommended)\n- A Sparse convolution backend (optional) see [here](https://github.com/nicolas-chaulet/torch-points3d#3d-sparse-convolution-support) for installation instructions\n\nFor a more seamless setup, it is recommended to use Docker. This approach ensures compatibility and eases the installation process, particularly when working with specific versions of CUDA and PyTorch. You can pull the appropriate Docker image as follows:\n\n```bash\ndocker pull pytorch/pytorch:1.10.0-cuda11.3-cudnn8-devel\n```\n\nAfter setting up the environment (either natively or through Docker), install the required Python package using pip:\n\n```bash\npip install torch-points3d\n```\n\n## Project structure\n\n```bash\n├─ benchmark               # Output from various benchmark runs\n├─ conf                    # All configurations for training nad evaluation leave there\n├─ notebooks               # A collection of notebooks that allow result exploration and network debugging\n├─ docker                  # Docker image that can be used for inference or training\n├─ docs                    # All the doc\n├─ eval.py                 # Eval script\n├─ find_neighbour_dist.py  # Script to find optimal #neighbours within neighbour search operations\n├─ forward_scripts         # Script that runs a forward pass on possibly non annotated data\n├─ outputs                 # All outputs from your runs sorted by date\n├─ scripts                 # Some scripts to help manage the project\n├─ torch_points3d\n    ├─ core                # Core components\n    ├─ datasets            # All code related to datasets\n    ├─ metrics             # All metrics and trackers\n    ├─ models              # All models\n    ├─ modules             # Basic modules that can be used in a modular way\n    ├─ utils               # Various utils\n    └─ visualization       # Visualization\n├─ test\n└─ train.py                # Main script to launch a training\n```\n\nAs a general philosophy we have split datasets and models by task. For example, datasets has five subfolders:\n\n- segmentation\n- classification\n- registration\n- object_detection\n- panoptic\n\nwhere each folder contains the dataset related to each task.\n\n## Methods currently implemented\n\n- **[PointNet](https://github.com/nicolas-chaulet/torch-points3d/blob/master/torch_points3d/modules/PointNet/modules.py#L54)** from Charles R. Qi _et al._: [PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation](https://arxiv.org/abs/1612.00593) (CVPR 2017)\n- **[PointNet++](https://github.com/nicolas-chaulet/torch-points3d/tree/master/torch_points3d/modules/pointnet2)** from Charles from Charles R. Qi _et al._: [PointNet++: Deep Hierarchical Feature Learning on Point Sets in a Metric Space](https://arxiv.org/abs/1706.02413)\n- **[RSConv](https://github.com/nicolas-chaulet/torch-points3d/tree/master/torch_points3d/modules/RSConv)** from Yongcheng Liu _et al._: [Relation-Shape Convolutional Neural Network for Point Cloud Analysis](https://arxiv.org/abs/1904.07601) (CVPR 2019)\n- **[RandLA-Net](https://github.com/nicolas-chaulet/torch-points3d/tree/master/torch_points3d/modules/RandLANet)** from Qingyong Hu _et al._: [RandLA-Net: Efficient Semantic Segmentation of Large-Scale Point Clouds](https://arxiv.org/abs/1911.11236)\n- **[PointCNN](https://github.com/nicolas-chaulet/torch-points3d/tree/master/torch_points3d/modules/PointCNN)** from Yangyan Li _et al._: [PointCNN: Convolution On X-Transformed Points](https://arxiv.org/abs/1801.07791) (NIPS 2018)\n- **[KPConv](https://github.com/nicolas-chaulet/torch-points3d/tree/master/torch_points3d/modules/KPConv)** from Hugues Thomas _et al._: [KPConv: Flexible and Deformable Convolution for Point Clouds](https://arxiv.org/abs/1904.08889) (ICCV 2019)\n- **[MinkowskiEngine](https://github.com/nicolas-chaulet/torch-points3d/tree/master/torch_points3d/modules/MinkowskiEngine)** from Christopher Choy _et al._: [4D Spatio-Temporal ConvNets: Minkowski Convolutional Neural Networks](https://arxiv.org/abs/1904.08755) (CVPR19)\n- **[VoteNet](https://github.com/nicolas-chaulet/torch-points3d/tree/master/torch_points3d/models/object_detection/votenet.py)** from Charles R. Qi _et al._: [Deep Hough Voting for 3D Object Detection in Point Clouds](https://arxiv.org/abs/1904.09664) (ICCV 19)\n- **[FCGF](https://github.com/chrischoy/FCGF)** from Christopher Choy _et al._: [Fully Convolutional Geometric Features](https://node1.chrischoy.org/data/publications/fcgf/fcgf.pdf) (ICCV'19)\n- **[PointGroup](https://github.com/Jia-Research-Lab/PointGroup)** from Li Jiang _et al._: [PointGroup: Dual-Set Point Grouping for 3D Instance Segmentation](https://arxiv.org/abs/2004.01658)\n- **[PPNet (PosPool)](https://github.com/zeliu98/CloserLook3D)** from Ze Liu _et al._: [A Closer Look at Local Aggregation Operators in Point Cloud Analysis](https://arxiv.org/pdf/2007.01294.pdf) (ECCV 2020)\n- **[TorchSparse](https://github.com/mit-han-lab/torchsparse)** from Haotian Tang _et al_: [Searching Efficient 3D Architectures with Sparse Point-Voxel Convolution](https://arxiv.org/abs/2007.16100)\n- **[PVCNN](https://github.com/mit-han-lab/pvcnn)** model for semantic segmentation from Zhijian Liu _et al_:[Point-Voxel CNN for Efficient 3D Deep Learning](https://arxiv.org/abs/1907.03739)\n- **[MS-SVConv](https://github.com/humanpose1/MS-SVConv)** from Sofiane Horache _et al_: [3D Point Cloud Registration with Multi-Scale Architecture and Self-supervised Fine-tuning](https://arxiv.org/abs/2103.14533)\n\nPlease refer to our [documentation](https://torch-points3d.readthedocs.io/en/latest/src/api/models.html) for accessing some of those models directly from the API and see our example notebooks for [KPconv](https://colab.research.google.com/github/nicolas-chaulet/torch-points3d/blob/master/notebooks/PartSegmentationKPConv.ipynb) and [RSConv](https://colab.research.google.com/github/nicolas-chaulet/torch-points3d/blob/master/notebooks/ObjectClassificationRSConv.ipynb) for more details.\n\n# Available Tasks\n\n|               \u003ch3\u003e Tasks \u003c/h3\u003e                |                      \u003ch3\u003e Examples \u003c/h3\u003e                      |\n| :-------------------------------------------: | :-----------------------------------------------------------: |\n| \u003ch3\u003e Classification / Part Segmentation \u003c/h3\u003e | \u003cimg src=\"docs/imgs/classification.png\"  height=\"220\"\u003e \u003cbr /\u003e |\n|            \u003ch3\u003e Segmentation \u003c/h3\u003e            |    \u003cimg src=\"docs/imgs/semantic.png\"  height=\"220\"\u003e \u003cbr /\u003e    |\n|          \u003ch3\u003e Object Detection \u003c/h3\u003e          |        \u003cimg src=\"docs/imgs/objects.png\" height=\"220\" \u003e        |\n|       \u003ch3\u003e Panoptic Segmentation \u003c/h3\u003e        |       \u003cimg src=\"docs/imgs/panoptic.png\"  height=\"220\"\u003e        |\n|            \u003ch3\u003e Registration \u003c/h3\u003e            |      \u003cimg src=\"docs/imgs/registration.png\" height=\"220\"\u003e      |\n\n# Available datasets\n\n## Segmentation\n\n- **[Scannet](https://github.com/ScanNet/ScanNet)** from Angela Dai _et al._: [ScanNet: Richly-annotated 3D Reconstructions of Indoor Scenes](https://arxiv.org/abs/1702.04405)\n\n- **[S3DIS](http://buildingparser.stanford.edu/dataset.html)** from Iro Armeni _et al._: [Joint 2D-3D-Semantic Data for Indoor Scene Understanding](https://arxiv.org/abs/1702.01105)\n\n```\n* S3DIS 1x1\n* S3DIS Room\n* S3DIS Fused - Sphere | Cylinder\n```\n\n- **[Shapenet](https://www.shapenet.org/)** from Angel X. Chang _et al._: [ShapeNet: An Information-Rich 3D Model Repository](https://arxiv.org/abs/1512.03012)\n\n## Object detection and panoptic\n\n- **[Scannet](https://github.com/ScanNet/ScanNet)** from Angela Dai _et al._: [ScanNet: Richly-annotated 3D Reconstructions of Indoor Scenes](https://arxiv.org/abs/1702.04405)\n- **[S3DIS](http://buildingparser.stanford.edu/dataset.html)** from Iro Armeni _et al._: [Joint 2D-3D-Semantic Data for Indoor Scene Understanding](https://arxiv.org/abs/1702.01105)\n\n```\n* S3DIS Fused - Sphere | Cylinder\n```\n\n- **[SemanticKitti](http://semantic-kitti.org/)** from J. Behley _et al_: [SemanticKITTI: A Dataset for Semantic Scene Understanding of LiDAR Sequences](https://arxiv.org/abs/1904.01416)\n\n## Registration\n\n- **[3DMatch](http://3dmatch.cs.princeton.edu)** from Andy Zeng _et al._: [3DMatch: Learning Local Geometric Descriptors from RGB-D Reconstructions](https://arxiv.org/abs/1603.08182)\n\n- **[The IRALab Benchmark](https://github.com/iralabdisco/point_clouds_registration_benchmark)** from Simone Fontana _et al._:[A Benchmark for Point Clouds Registration Algorithms](https://arxiv.org/abs/2003.12841), which is composed of data from:\n\n  - [the ETH datasets](https://projects.asl.ethz.ch/datasets/doku.php?id=laserregistration:laserregistration);\n  - [the Canadian Planetary Emulation Terrain 3D Mapping datasets](http://asrl.utias.utoronto.ca/datasets/3dmap/index.html);\n  - [the TUM Vision Groud RGBD datasets](https://vision.in.tum.de/data/datasets/rgbd-dataset);\n  - [the KAIST Urban datasets](https://irap.kaist.ac.kr/dataset/).\n\n- **[Kitti odometry](http://www.cvlibs.net/datasets/kitti/eval_odometry.php)** with corrected poses (thanks to @humanpose1) from A. Geiger _et al_: [Are we ready for Autonomous Driving? The KITTI Vision Benchmark Suite](http://www.cvlibs.net/publications/Geiger2012CVPR.pdf)\n\n## Classification\n\n- **[ModelNet](https://modelnet.cs.princeton.edu)** from Zhirong Wu _et al._: [3D ShapeNets: A Deep Representation for Volumetric Shapes](https://people.csail.mit.edu/khosla/papers/cvpr2015_wu.pdf)\n\n# 3D Sparse convolution support\n\nWe currently support [Minkowski Engine](https://github.com/StanfordVL/MinkowskiEngine) \u003e v0.5 and [torchsparse](https://github.com/mit-han-lab/torchsparse) \u003e= v1.4.0 as backends for sparse convolutions. Those packages need to be installed independently from Torch Points3d, please follow installation instructions and troubleshooting notes on the respective repositories. At the moment `MinkowskiEngine` [see here (thank you Chris Choy)](https://gist.github.com/chrischoy/d8e971daf8308aa1dcba1524bf1fd91a) demonstrates faster training. **Please be aware that `torchsparse` is still in beta and does not support CPU only training.**\n\nOnce you have setup one of those two sparse convolution framework you can start using are high level to define a unet backbone or simply an encoder:\n\n```python\nfrom torch_points3d.applications.sparseconv3d import SparseConv3d\n\nmodel = SparseConv3d(\"unet\", input_nc=3, output_nc=5, num_layers=4, backend=\"torchsparse\") # minkowski by default\n```\n\nYou can also assemble your own networks by using the modules provided in `torch_points3d/modules/SparseConv3d/nn`. For example if you wish to use `torchsparse` backend you can do the following:\n\n```python\nimport torch_points3d.modules.SparseConv3d as sp3d\n\nsp3d.nn.set_backend(\"torchsparse\")\nconv = sp3d.nn.Conv3d(10, 10)\nbn = sp3d.nn.BatchNorm(10)\n```\n\n### Mixed Precision Training\n\nMixed precision allows for lower memory on the GPU and slightly faster training times by performing the sparse convolution, pooling, and gradient ops in `float16`. Mixed precision training is currently supported for CUDA training on `SparseConv3d` networks with the [torchsparse](https://github.com/mit-han-lab/torchsparse) backend. To enable mixed precision, ensure you have the latest version of torchsparse with `pip install --upgrade git+https://github.com/mit-han-lab/torchsparse.git`. Then, set `training.enable_mixed=True` in your training configuration files. If all the conditions are met, when you start training you will see a log entry stating:\n\n`[torch_points3d.models.base_model][INFO] - Model will use mixed precision`\n\nIf, however, you try to use mixed precision training with an unsupported backend, you will see:\n\n`[torch_points3d.models.base_model][WARNING] - Mixed precision is not supported on this model, using default precision...`\n\n# Adding your model to the PretrainedRegistry.\n\nThe `PretrainedRegistry` enables anyone to add their own pre-trained models and `re-create` them with only 2 lines of code for `finetunning` or `production` purposes.\n\n- `[You]` Launch your model training with [Wandb](https://www.wandb.com) activated (`wandb.log=True`)\n- `[TorchPoints3d]` Once the training finished, `TorchPoints3d` will upload your trained model within [our custom checkpoint](https://app.wandb.ai/nicolas/scannet/runs/1sd84bf1) to your wandb.\n- `[You]` Within [`PretainedRegistry`](https://github.com/nicolas-chaulet/torch-points3d/blob/master/torch_points3d/applications/pretrained_api.py#L31) class, add a `key-value pair` within its attribute `MODELS`. The `key` should be describe your model, dataset and training hyper-parameters (possibly the best model), the `value` should be the `url` referencing the `.pt` file on your wandb.\n\nExample: Key: `pointnet2_largemsg-s3dis-1` and URL value: `https://api.wandb.ai/files/loicland/benchmark-torch-points-3d-s3dis/1e1p0csk/pointnet2_largemsg.pt` for the `pointnet2_largemsg.pt` file.\nThe key desribes a `pointnet2 largemsg trained on s3dis fold 1`.\n\n- `[Anyone]` By using the `PretainedRegistry` class and by providing the `key`, the associated model weights will be `downloaded` and the pre-trained model will be `ready to use` with its transforms.\n\n```python\n[In]:\nfrom torch_points3d.applications.pretrained_api import PretainedRegistry\n\nmodel = PretainedRegistry.from_pretrained(\"pointnet2_largemsg-s3dis-1\")\n\nprint(model.wandb)\nprint(model.print_transforms())\n\n[Out]:\n=================================================== WANDB URLS ======================================================\nWEIGHT_URL: https://api.wandb.ai/files/loicland/benchmark-torch-points-3d-s3dis/1e1p0csk/pointnet2_largemsg.pt\nLOG_URL: https://app.wandb.ai/loicland/benchmark-torch-points-3d-s3dis/runs/1e1p0csk/logs\nCHART_URL: https://app.wandb.ai/loicland/benchmark-torch-points-3d-s3dis/runs/1e1p0csk\nOVERVIEW_URL: https://app.wandb.ai/loicland/benchmark-torch-points-3d-s3dis/runs/1e1p0csk/overview\nHYDRA_CONFIG_URL: https://app.wandb.ai/loicland/benchmark-torch-points-3d-s3dis/runs/1e1p0csk/files/hydra-config.yaml\nOVERRIDES_URL: https://app.wandb.ai/loicland/benchmark-torch-points-3d-s3dis/runs/1e1p0csk/files/overrides.yaml\n======================================================================================================================\n\npre_transform = None\ntest_transform = Compose([\n    FixedPoints(20000, replace=True),\n    XYZFeature(axis=['z']),\n    AddFeatsByKeys(rgb=True, pos_z=True),\n    Center(),\n    ScalePos(scale=0.5),\n])\ntrain_transform = Compose([\n    FixedPoints(20000, replace=True),\n    RandomNoise(sigma=0.001, clip=0.05),\n    RandomRotate((-180, 180), axis=2),\n    RandomScaleAnisotropic([0.8, 1.2]),\n    RandomAxesSymmetry(x=True, y=False, z=False),\n    DropFeature(proba=0.2, feature='rgb'),\n    XYZFeature(axis=['z']),\n    AddFeatsByKeys(rgb=True, pos_z=True),\n    Center(),\n    ScalePos(scale=0.5),\n])\nval_transform = Compose([\n    FixedPoints(20000, replace=True),\n    XYZFeature(axis=['z']),\n    AddFeatsByKeys(rgb=True, pos_z=True),\n    Center(),\n    ScalePos(scale=0.5),\n])\ninference_transform = Compose([\n    FixedPoints(20000, replace=True),\n    XYZFeature(axis=['z']),\n    AddFeatsByKeys(rgb=True, pos_z=True),\n    Center(),\n    ScalePos(scale=0.5),\n])\npre_collate_transform = Compose([\n    PointCloudFusion(),\n    SaveOriginalPosId,\n    GridSampling3D(grid_size=0.04, quantize_coords=False, mode=mean),\n])\n```\n\n# Developer guidelines\n\n## Setting repo\n\nWe use [Poetry](https://poetry.eustace.io/) for managing our packages.\nIn order to get started, clone this repositories and run the following command from the root of the repo\n\n```\npoetry install --no-root\n```\n\nThis will install all required dependencies in a new virtual environment.\n\nActivate the environment\n\n```bash\npoetry shell\n```\n\nYou can check that the install has been successful by running\n\n```bash\npython -m unittest -v\n```\n\nFor `pycuda` support (only needed for the registration tasks):\n\n```bash\npip install pycuda\n```\n\n## Getting started: Train pointnet++ on part segmentation task for dataset shapenet\n\n```bash\npoetry run python train.py task=segmentation models=segmentation/pointnet2 model_name=pointnet2_charlesssg data=segmentation/shapenet-fixed\n```\n\nAnd you should see something like that\n\n![logging](https://raw.githubusercontent.com/nicolas-chaulet/torch-points3d/master/docs/imgs/logging.png)\n\nThe [config](https://raw.githubusercontent.com/nicolas-chaulet/torch-points3d/master/conf/models/segmentation/pointnet2.yaml) for pointnet++ is a good example of how to define a model and is as follow:\n\n```yaml\n# PointNet++: Deep Hierarchical Feature Learning on Point Sets in a Metric Space (https://arxiv.org/abs/1706.02413)\n# Credit Charles R. Qi: https://github.com/charlesq34/pointnet2/blob/master/models/pointnet2_part_seg_msg_one_hot.py\n\npointnet2_onehot:\n  architecture: pointnet2.PointNet2_D\n  conv_type: \"DENSE\"\n  use_category: True\n  down_conv:\n    module_name: PointNetMSGDown\n    npoint: [1024, 256, 64, 16]\n    radii: [[0.05, 0.1], [0.1, 0.2], [0.2, 0.4], [0.4, 0.8]]\n    nsamples: [[16, 32], [16, 32], [16, 32], [16, 32]]\n    down_conv_nn:\n      [\n        [[FEAT, 16, 16, 32], [FEAT, 32, 32, 64]],\n        [[32 + 64, 64, 64, 128], [32 + 64, 64, 96, 128]],\n        [[128 + 128, 128, 196, 256], [128 + 128, 128, 196, 256]],\n        [[256 + 256, 256, 256, 512], [256 + 256, 256, 384, 512]],\n      ]\n  up_conv:\n    module_name: DenseFPModule\n    up_conv_nn:\n      [\n        [512 + 512 + 256 + 256, 512, 512],\n        [512 + 128 + 128, 512, 512],\n        [512 + 64 + 32, 256, 256],\n        [256 + FEAT, 128, 128],\n      ]\n    skip: True\n  mlp_cls:\n    nn: [128, 128]\n    dropout: 0.5\n```\n\n## Inference\n\n### Inference script\n\nWe provide a script for running a given pre trained model on custom data that may not be annotated. You will find an [example](https://github.com/nicolas-chaulet/torch-points3d/blob/master/forward_scripts/forward.py) of this for the part segmentation task on Shapenet. Just like for the rest of the codebase most of the customization happens through config files and the provided example can be extended to other datasets. You can also easily create your own from there. Going back to the part segmentation task, say you have a folder full of point clouds that you know are Airplanes, and you have the checkpoint of a model trained on Airplanes and potentially other classes, simply edit the [config.yaml](https://github.com/nicolas-chaulet/torch-points3d/blob/master/forward_scripts/conf/config.yaml) and [shapenet.yaml](https://github.com/nicolas-chaulet/torch-points3d/blob/master/forward_scripts/conf/dataset/shapenet.yaml) and run the following command:\n\n```bash\npython forward_scripts/forward.py\n```\n\nThe result of the forward run will be placed in the specified `output_folder` and you can use the [notebook](https://github.com/nicolas-chaulet/torch-points3d/blob/master/forward_scripts/notebooks/viz_shapenet.ipynb) provided to explore the results. Below is an example of the outcome of using a model trained on caps only to find the parts of airplanes and caps.\n\n![resexplore](https://raw.githubusercontent.com/nicolas-chaulet/torch-points3d/master/docs/imgs/inference_demo.gif)\n\n### Containerizing your model with Docker\n\nFinally, for people interested in deploying their models to production environments, we provide a [Dockerfile](https://github.com/nicolas-chaulet/torch-points3d/blob/master/docker/Dockerfile) as well as a [build script](https://github.com/nicolas-chaulet/torch-points3d/blob/master/docker/build.sh). Say you have trained a network for semantic segmentation that gave the weight `\u003coutputfolder/weights.pt\u003e`, the following command will build a docker image for you:\n\n```bash\ncd docker\n./build.sh outputfolder/weights.pt\n```\n\nYou can then use it to run a forward pass on a all the point clouds in `input_path` and generate the results in `output_path`\n\n```bash\ndocker run -v /test_data:/in -v /test_data/out:/out pointnet2_charlesssg:latest python3 forward_scripts/forward.py dataset=shapenet data.forward_category=Cap input_path=\"/in\" output_path=\"/out\"\n```\n\nThe `-v` option mounts a local directory to the container's file system. For example in the command line above, `/test_data/out` will be mounted at the location `/out`. As a consequence, all files written in `/out` will be available in the folder `/test_data/out` on your machine.\n\n## Profiling\n\nWe advice to use [`snakeviz`](https://jiffyclub.github.io/snakeviz/) and [`cProfile`](https://docs.python.org/2/library/profile.html)\n\nUse cProfile to profile your code\n\n```\npoetry run python -m cProfile -o {your_name}.prof train.py ... debugging.profiling=True\n```\n\nAnd visualize results using snakeviz.\n\n```\nsnakeviz {your_name}.prof\n```\n\nIt is also possible to use [`torch.utils.bottleneck`](https://pytorch.org/docs/stable/bottleneck.html)\n\n```\npython -m torch.utils.bottleneck /path/to/source/script.py [args]\n```\n\n## Troubleshooting\n\n### Cannot compile certain CUDA Kernels or seg faults while running the tests\n\nEnsure that at least PyTorch 1.8.0 is installed and verify that `cuda/bin` and `cuda/include` are in your `$PATH` and `$CPATH` respectively, e.g.:\n\n```\n$ python -c \"import torch; print(torch.__version__)\"\n\u003e\u003e\u003e 1.8.0\n\n$ echo $PATH\n\u003e\u003e\u003e /usr/local/cuda/bin:...\n\n$ echo $CPATH\n\u003e\u003e\u003e /usr/local/cuda/include:...\n```\n\n### Undefined symbol / Updating Pytorch\n\nWhen we update the version of Pytorch that is used, the compiled packages need to be reinstalled, otherwise you will run into an error that looks like this:\n\n```\n... scatter_cpu.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN3c1012CUDATensorIdEv\n```\n\nThis can happen for the following libraries:\n\n- torch-points-kernels\n- torch-scatter\n- torch-cluster\n- torch-sparse\n\nAn easy way to fix this is to run the following command with the virtual env activated:\n\n```\npip uninstall torch-scatter torch-sparse torch-cluster torch-points-kernels -y\nrm -rf ~/.cache/pip\npoetry install\n```\n\n### CUDA kernel failed : no kernel image is available for execution on the device\n\nThis can happen when trying to run the code on a different GPU than the one used to compile the `torch-points-kernels` library. Uninstall `torch-points-kernels`, clear cache, and reinstall after setting the `TORCH_CUDA_ARCH_LIST` environment variable. For example, for compiling with a Tesla T4 (Turing 7.5) and running the code on a Tesla V100 (Volta 7.0) use:\n\n```\nexport TORCH_CUDA_ARCH_LIST=\"7.0;7.5\"\n```\n\nSee [this useful chart](http://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/) for more architecture compatibility.\n\n### Cannot use wandb on Windows\n\nRaises `OSError: [WinError 6] The handle is invalid` / `wandb: ERROR W\u0026B process failed to launch`\nWandb is currently broken on Windows (see [this issue](https://github.com/wandb/client/issues/862)), a workaround is to use the command line argument `wandb.log=false`\n\n# Exploring your experiments\n\nWe provide a [notebook](https://github.com/nicolas-chaulet/torch-points3d/blob/master/notebooks/dashboard.ipynb) based [pyvista](https://docs.pyvista.org/) and [panel](https://panel.holoviz.org/) that allows you to explore your past experiments visually. When using jupyter lab you will have to install an extension:\n\n```\njupyter labextension install @pyviz/jupyterlab_pyviz\n```\n\nRun through the notebook and you should see a dashboard starting that looks like the following:\n\n![dashboard](https://raw.githubusercontent.com/nicolas-chaulet/torch-points3d/master/docs/imgs/Dashboard_demo.gif)\n\n# Contributing\n\nContributions are welcome! The only asks are that you stick to the styling and that you add tests as you add more features!\n\nFor styling you can use [pre-commit hooks](https://ljvmiranda921.github.io/notebook/2018/06/21/precommits-using-black-and-flake8/) to help you:\n\n```\npre-commit install\n```\n\nA sequence of checks will be run for you and you may have to add the fixed files again to the stashed files.\n\nWhen it comes to docstrings we use [numpy style](https://numpydoc.readthedocs.io/en/latest/format.html) docstrings, for those who use\nVisual Studio Code, there is a great [extension](https://github.com/NilsJPWerner/autoDocstring) that can help with that. Install it and set the format to numpy and you should be good to go!\n\nFinaly, if you want to have a direct chat with us feel free to join our slack, just shoot us an email and we'll add you.\n\n# Citing\n\nIf you find our work useful, do not hesitate to cite it:\n\n```\n@inproceedings{\n  tp3d,\n  title={Torch-Points3D: A Modular Multi-Task Frameworkfor Reproducible Deep Learning on 3D Point Clouds},\n  author={Chaton, Thomas and Chaulet Nicolas and Horache, Sofiane and Landrieu, Loic},\n  booktitle={2020 International Conference on 3D Vision (3DV)},\n  year={2020},\n  organization={IEEE},\n  url = {\\url{https://github.com/nicolas-chaulet/torch-points3d}}\n}\n```\n\nand please also include a citation to the\n[models](https://github.com/nicolas-chaulet/torch-points3d#methods-currently-implemented)\nor the [datasets](https://github.com/nicolas-chaulet/torch-points3d#available-datasets) you have used in your experiments!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorch-points3d%2Ftorch-points3d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftorch-points3d%2Ftorch-points3d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorch-points3d%2Ftorch-points3d/lists"}