{"id":22862759,"url":"https://github.com/nedap/grape","last_synced_at":"2025-07-07T08:38:10.545Z","repository":{"id":255378745,"uuid":"849406561","full_name":"nedap/GRAPE","owner":"nedap","description":"Graph Representation of Advanced Part Encodings (GRAPE), a novel framework for anatomical structure identification in three-dimensional point clouds of human bodies.","archived":false,"fork":false,"pushed_at":"2024-08-30T13:00:25.000Z","size":2714,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T04:07:54.719Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nedap.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-29T14:38:15.000Z","updated_at":"2025-01-25T16:36:02.000Z","dependencies_parsed_at":"2024-08-29T16:53:11.387Z","dependency_job_id":"8bc0681c-9ba5-4741-9a9e-b0a99ad2abd6","html_url":"https://github.com/nedap/GRAPE","commit_stats":null,"previous_names":["nedap/grape"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nedap%2FGRAPE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nedap%2FGRAPE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nedap%2FGRAPE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nedap%2FGRAPE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nedap","download_url":"https://codeload.github.com/nedap/GRAPE/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246443525,"owners_count":20778247,"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":[],"created_at":"2024-12-13T10:14:42.139Z","updated_at":"2025-03-31T08:46:52.638Z","avatar_url":"https://github.com/nedap.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Self-Supervised Representation Learning in Point Clouds for Hierarchical Graph-Based Anatomical Structure Identification\nby Niels Rocholl\n\nSupervised by Thomas Markus and Matthia Sabatelli\n\nGraph Representation of Advanced Part Encodings (GRAPE) is a novel framework for identifying anatomical structures in 3D point clouds of human bodies. GRAPE integrates self-supervised learning with graph neural networks to create graph-based representations of 3D objects. Each node in the graph is enriched with latent features derived from the object's parts, generated using a Masked Autoencoder (Point-MAE), which captures the geometric and spatial information of the point cloud.\n\n\u003c!-- I use an MAE approach, similar to [PointMAE](https://github.com/Pang-Yatian/Point-MAE) for SSL.  --\u003e\n\n# Environment\nThis code has been tested on\n- PyTorch: 2.2.2\n- Cuda: 12.1\n- Cudnn: 8\n- Python 3.11\n\nThe following image was used in our container: \n```\npytorch/pytorch:2.2.2-cuda12.1-cudnn8-devel\n```\n\n# Installation steps\n\n### python packages\nThe followin command should install **ALL** required packages. \n\n```\npip install -r requirements.txt\n```\n\nThis codebase uses some custom cuda implementations to facilitate GPU acceleration of certain algorithms (FPS, KNN, Chamfer Distance). All these are included in the [requirements.txt](requirements.txt). Below you can find further information on these algorithms. \n\n### Chamfer Distance\n\nThis project uses a custom loss function based on the [Chamfer Distance](https://arxiv.org/pdf/1612.00603.pdf), which a method to compute the similarity between two sets of points in 3D space. This function is written in cuda and c++. Our implemtation is based on [GRNet](https://github.com/hzxie/GRNet/tree/master/extensions/chamfer_dist), credits go to Haozhe Xie.\nI created a installable python package from this code, which is already included in our [requirements.txt](requirements.txt). \n\nHowever, it can also be installed manually via:\n\n```\npip install git+https://github.com/nielsRocholl/chamfer-distance.git\n```\n\n### FPS\n\nThis project uses a c++/cuda implementation of FPS to allow for GPU acceleration of this algorithms. The original implemention can be found on [Pointnet2_PyTorch](https://github.com/erikwijmans/Pointnet2_PyTorch/tree/master/pointnet2_ops_lib). \n\nI created a installable python package from this code, which is already included in our [requirements.txt](requirements.txt). \n\nHowever, it can also be installed manually via:\n\n```\npip install git+https://github.com/nielsRocholl/fps-cuda.git\n```\n\n### KNN (knn_cuda)\n\nWe use the following implementation of KNN [KNN_CUDA](https://github.com/unlimblue/KNN_CUDA) which is already installed through the [requirements.txt](requirements.txt). \n\nHowever, it can also be installed manually via:\n\n```\npip install --upgrade https://github.com/unlimblue/KNN_CUDA/releases/download/0.2/KNN_CUDA-0.2-py3-none-any.whl\n```\n\n# How to Run\n\nto train Point-MAE:\n```\npython main.py --config cfgs/train_ssl/train_ssl_caesar.yaml --wandb\n```\n\nto generate the Graph Dataset using the trained Point-MAE:\n```\npython main.py --config cfgs/build_gnn_ds/build_gnn_ds_ceasar.yaml --build_gnn_ds\n```\n\nto train the Graph Neural Network for node classification:\n```\npython main.py --config cfgs/train_gnn/train_gnn_caesar.yaml --train_gnn\n```\n\n## How to run specific experiments\n\nrun embedding noise experiment:\n```\npython main.py --config cfgs/noised_embedding_exp.yaml --train_gnn --k_fold --wandb\n```\n\n## How to build the default graph:\n\n```\npython main.py --config cfgs/default_graph/build_default_graph_ceasar.yaml --build_default_graph\n```\n\n### General Project Information.\n\nWe try to produce high quality, understandable code. Key features included in this repository are:\n\n- **Configuration Management**: Utilizes YAML files for configuration management.\n- **Experiment Tracking**: Incorporates Weights and Biases for precise experiment tracking.\n- **Configuration Loaders and Writers**: Facilitates easy management of configuration data.\n- **Custom Logger**: A logger designed to support distributed computing environments.\n- **Custom Argument Parser**: A argument parser to streamline command-line interactions.\n- **Class Registry**: A registry to effortlessly map strings to classes.\n- **Dataset Class**: A dataset class to handle data operations seamlessly.\n- **IO Class**: A dedicated IO class to manage data input and error handling efficiently.\n\nEach function within this project is documented with comprehensive docstrings, comments, and proper typing. The primary adjustment required post-setup is updating the Weights and Biases Project name within the `main.py` file. In addition to example text in the configuration files. \n\nThe project structure is illustrated below:\n\n```plaintext\ntoy-problem/\n│\n├── DATASET.md\n├── README.md\n├── cfgs\n│   ├── dataset_cfgs\n│   │   └── part_net.yaml\n│   └── train.yaml\n│\n├── dataset\n│   ├── build.py\n│   ├── io.py\n│   └── part_net.py\n│\n├── experiments\n│   └── train\n│       └── cfgs\n│           ├── TFBoard\n│           │   └── experiment\n│           └── experiment\n│               └── wandb\n│\n├── main.py\n├── models\n│\n├── output\n│   ├── figures\n│   └── trained-models\n│\n├── requirements.txt\n├── tools\n│   ├── model_tester.py\n│   └── model_trainer.py\n│\n└── utils\n    ├── config.py\n    ├── logger.py\n    ├── misc.py\n    ├── parser.py\n    └── registry.py\n```\n\n\n### Troubleshooting Errors\n\nIf you encounter the following error:\n```\nImportError: libGL.so.1: cannot open shared object file: No such file or directory\n```\n\nThen run:\n\n```\napt-get update \u0026\u0026 apt-get install ffmpeg libsm6 libxext6  -y\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnedap%2Fgrape","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnedap%2Fgrape","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnedap%2Fgrape/lists"}