{"id":25289088,"url":"https://github.com/ltriess/pointnet2_keras","last_synced_at":"2025-04-06T17:46:51.355Z","repository":{"id":50249646,"uuid":"355203737","full_name":"ltriess/pointnet2_keras","owner":"ltriess","description":":sparkles: PointNet++ feature extractor and output heads implemented in TensorFlow 1.15 with Keras Models","archived":false,"fork":false,"pushed_at":"2021-06-08T08:13:19.000Z","size":47,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-12T23:50:02.987Z","etag":null,"topics":["keras-tensorflow","pointnet2","python3","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ltriess.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-06T13:43:55.000Z","updated_at":"2024-05-22T15:41:08.000Z","dependencies_parsed_at":"2022-08-25T19:01:56.779Z","dependency_job_id":null,"html_url":"https://github.com/ltriess/pointnet2_keras","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ltriess%2Fpointnet2_keras","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ltriess%2Fpointnet2_keras/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ltriess%2Fpointnet2_keras/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ltriess%2Fpointnet2_keras/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ltriess","download_url":"https://codeload.github.com/ltriess/pointnet2_keras/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247526677,"owners_count":20953141,"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":["keras-tensorflow","pointnet2","python3","tensorflow"],"created_at":"2025-02-12T23:50:13.345Z","updated_at":"2025-04-06T17:46:51.314Z","avatar_url":"https://github.com/ltriess.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## TF1 Keras implementation for PointNet++ Model\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n![version](https://img.shields.io/badge/version-0.1.0-blue)\n\nThis repository holds the implementation of the PointNet++ Model.\nThere is no training code contained, it is simply to use the model as a place-in feature extractor in other projects.\n\nThe original PointNet++ code can be found [here](https://github.com/charlesq34/pointnet2).\nIt also provides the entire training pipeline for PointNet++.\n\n### Installation\nThe code requires Python 3.6 and TensorFlow 1.15 GPU version.\n```commandline\npip install git+https://github.com/ltriess/pointnet2_keras\n```\nIf you want to install TF15 alongside, use\n```commandline\npip install git+https://github.com/ltriess/pointnet2_keras[tf-gpu]  # for gpu support\npip install git+https://github.com/ltriess/pointnet2_keras[tf-cpu]  # for cpu support\n```\n\n#### Compile Customized TF Operators\nThe TF operators are included under `tf_ops`.\nCheck `tf_xxx_compile.sh` under each ops subfolder to compile the operators.\nThe scripts are tested under TF1.15.\n\nFirst, find TensorFlow include and library paths.\n```commandline\nTF_CFLAGS=( $(python -c 'import tensorflow as tf; print(\" \".join(tf.sysconfig.get_compile_flags()))') )\nTF_LFLAGS=( $(python -c 'import tensorflow as tf; print(\" \".join(tf.sysconfig.get_link_flags()))') )\n```\nThen, build the op (name indicated as `xxx`) located in each subfolder.\n```commandline\n/usr/local/cuda/bin/nvcc -std=c++11 -c -o tf_xxx_g.cu.o tf_xxx_g.cu ${TF_CFLAGS[@]} -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC\ng++ -std=c++11 -shared -o tf_xxx_so.so tf_xxx.cpp tf_xxx_g.cu.o ${TF_CFLAGS[@]} -fPIC -lcudart ${TF_LFLAGS[@]} -I/usr/local/cuda/include -L/usr/local/cuda/lib64\n```\n\nThis implementation does not provide the nearest neighbor op.\nThe original implementation is not suited to deal with very large point clouds (the target of our work).\nHowever, we cannot provide our implementation of the efficient KNN op.\nYou can plug in your custom TF ops `my_tf_ops` and use your KNN implementation in `layers/sample_and_group.py`\n(refer to call `from my_tf_ops.knn_op import k_nearest_neighbor_op as get_knn`).\n\n### Usage\nThis repo provides the implementation of the PointNet++ model without any additional code.\nIn your project, you can use the feature extractor and the classification and segmentation heads from this implementation independently.\n\n#### Classification\n```python\nimport tensorflow as tf\nfrom pointnet2 import Classifier, FeatureExtractor\n\nfeature_extractor = FeatureExtractor(\n    mlp_point=[[64, 64, 128], [128, 128, 256], [256, 512, 1024]],\n    num_queries=[512, 128, None],\n    num_neighbors=[32, 64, None],\n    radius=[0.2, 0.4, None],\n    reduce=True,\n    use_knn=False,\n)\n\nclassifier = Classifier(units=[256, 128, 40], dropout_rate=0.4)\n\npoints = tf.random.normal(shape=(2, 2048, 3))\nfeatures, _ = feature_extractor(points)  # [2, 1024]\nclassification_predictions = classifier(features)  # [2, 40]\n```\n\n#### Segmentation\n```python\nimport tensorflow as tf\nfrom pointnet2 import FeatureExtractor, SegmentationModel\n\nfeature_extractor = FeatureExtractor(\n    mlp_point=[[32, 32, 64], [64, 64, 128], [128, 128, 256], [256, 256, 512]],\n    num_queries=[1024, 256, 64, 16],\n    num_neighbors=[32, 32, 32, 32],\n    radius=[0.1, 0.2, 0.4, 0.8],\n    reduce=False,\n    use_knn=False,\n)\n\nsegmentation_model = SegmentationModel(\n    fp_units=[[256, 256], [256, 256], [256, 128, 128]], num_classes=12\n)\n\npoints = tf.random.normal(shape=(2, 2048, 3))\n_, abstraction_output = feature_extractor(points)  # [2, 16, 512]\nsegmentation_predictions = segmentation_model(abstraction_output)  # [4, 2048, 12]\n```\n\n### License\nThis code is released under MIT License (see [LICENSE](LICENSE) for details).\nThis code is adapted from [charlesq34/pointnet2](https://github.com/charlesq34/pointnet2), as indicated in each affected file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fltriess%2Fpointnet2_keras","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fltriess%2Fpointnet2_keras","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fltriess%2Fpointnet2_keras/lists"}