{"id":13435658,"url":"https://github.com/dgriffiths3/pointnet2-tensorflow2","last_synced_at":"2025-03-18T11:31:51.887Z","repository":{"id":52651583,"uuid":"226208481","full_name":"dgriffiths3/pointnet2-tensorflow2","owner":"dgriffiths3","description":"Pointnet++ modules implemented as tensorflow 2 keras layers.","archived":false,"fork":false,"pushed_at":"2021-04-22T08:48:49.000Z","size":170,"stargazers_count":92,"open_issues_count":7,"forks_count":41,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-27T18:58:27.663Z","etag":null,"topics":["classification","deep-learning","point-cloud","pointnet","pointnet2","segmentation","tensorflow","tensorflow2"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dgriffiths3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-05T23:41:35.000Z","updated_at":"2024-09-23T02:07:02.000Z","dependencies_parsed_at":"2022-08-22T02:00:49.877Z","dependency_job_id":null,"html_url":"https://github.com/dgriffiths3/pointnet2-tensorflow2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgriffiths3%2Fpointnet2-tensorflow2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgriffiths3%2Fpointnet2-tensorflow2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgriffiths3%2Fpointnet2-tensorflow2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgriffiths3%2Fpointnet2-tensorflow2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dgriffiths3","download_url":"https://codeload.github.com/dgriffiths3/pointnet2-tensorflow2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244211093,"owners_count":20416581,"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":["classification","deep-learning","point-cloud","pointnet","pointnet2","segmentation","tensorflow","tensorflow2"],"created_at":"2024-07-31T03:00:37.834Z","updated_at":"2025-03-18T11:31:46.879Z","avatar_url":"https://github.com/dgriffiths3.png","language":"C++","funding_links":[],"categories":["Model 💛💛💛💛💛\u003ca name=\"Model\" /\u003e","Sample Codes / Projects \u003ca name=\"sample\" /\u003e ⛏️📐📁"],"sub_categories":["Point Model 点云模型","Reinforcement Learning \u003ca name=\"RL\" /\u003e🔮"],"readme":"# Pointnet++ tensorflow 2.0 layers\n\n\u003e Note: For the newer PointConv layers in tensorflow 2.x visit the repostiory [here](https://github.com/dgriffiths3/pointconv-tensorflow2).\n\nThe repository contains implementations of the pointnet++ set abstraction and feature propagation layers as `tf.keras.layers` classes. The intention is not to be a full pointnet++ tensorflow 2.0 implementation, but provide an easy way to build a pointnet++ style network architecture using the tensorflow 2.0 keras api. For reference here is the original [paper](https://arxiv.org/pdf/1706.02413.pdf) and [code](https://github.com/charlesq34/pointnet2). Where possible I have tried to directly copy and paste original code to avoid discrepancies.\n\n## Setup\n\nRequirements:\n\n* python \u003e= 3.0+\n* tensorflow-gpu \u003e= 2.2+\n* cuda == 10.1\n\u003e Note: This repository uses the `train_step` model override which is new for `tensorflow 2.2.0`, as such if you wish to use the provided training scripts it is important your tensorflow is not an older version. The layers will work for tensorflow 2.0+.\n\nTo compile the tensorflow Ops first ensure the `CUDA_ROOT` path in `tf_ops/compile_ops.sh` points correctly to you cuda folder then compile the ops with:\n\n```\nchmod u+x tf_ops/compile_ops.sh\ntf_ops/compile_ops.sh\n```\n\n## Usage\n\nThe layers should work as direct replacements for standard `tf.keras.layers` layers, most similarly `Conv2D`. To import just run `from pnet2_layers.layers import \u003cLAYER_NAME\u003e`. To use in your own project just copy the pnet2_layers folder into your project structure and locate with either relative or absolute imports.\n\nFor example, to mimic the `pointnet2_cls_ssg` model in the original repository as a custom model, it would look like:\n\n```\nimport tensorflow\nfrom pnet2_layers.layers import Pointnet_SA\n\nclass CLS_SSG_Model(tf.keras.Model)\n\n  def __init__(self, batch_size, activation=tf.nn.relu):\n    super(Pointnet2Encoder, self).__init__()\n\n    self.batch_size = batch_size\n\n    self.layer1 = Pointnet_SA(npoint=512, radius=0.2, nsample=32, mlp=[64, 64, 128], group_all=False, activation=self.activation)\n    self.layer1 = Pointnet_SA(npoint=128, radius=0.4, nsample=32, mlp=[128, 128, 256], group_all=False, activation=self.activation)\n    self.layer1 = Pointnet_SA(npoint=None, radius=None, nsample=None, mlp=[256, 512, 1024], group_all=False, activation=self.activation)\n\n    # The rest of the model can be implemented using standard tf.keras.layers (Dense and dropout).\n\n  def call():\n\n    xyz, points = self.layer1(input, None)\n    xyz, points = self.layer2(xyz, points)\n    xyz, points = self.layer3(xyz, points)\n\n    points = tf.reshape(points, (self.batch_size, -1))\n\n    # run points through dense / dropout layers.\n\n    return points\n```\n\nExamples of a few of the models from the original repository can be found in the `models` folder.\n\nTo run the ModelNet or ScanNet example first download the `tfrecords` containing the training data from [here](https://drive.google.com/open?id=1v5B68RHgDI95KM4EhDrRJxLacJAHcoxz) and place in a folder called `data`. To start the training script run either:\n\n```\npython train_modelnet.py\n```\nor:\n```\npython train_scannet.py\n```\n\nYou can view training logs with:\n\n```\ntensorboard --logdir=logs --port=6006\n```\n\nand navigate to `localhost:6006` in a web browser.\n\nBy default this runs the multi-scale grouping modules. To run the standard set abstraction layer without multi-scale grouping, set `msg` to `False` in the `params` dictionary.\n\n## Notes\n\nI have implemented [batch normalization](https://towardsdatascience.com/batch-normalization-in-neural-networks-1ac91516821c) for all pointnet++ layers in the model files. I personally find I get better results on real world datasets when this option is set to `False`. In the original implementation this batch normalization is set to `True`.\n\nIf you use this repository and find any bugs please submit an issue so I can fix them for anyone else using the code.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgriffiths3%2Fpointnet2-tensorflow2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdgriffiths3%2Fpointnet2-tensorflow2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgriffiths3%2Fpointnet2-tensorflow2/lists"}