{"id":26187611,"url":"https://github.com/gmum/loconda","last_synced_at":"2025-04-15T00:50:38.819Z","repository":{"id":75662814,"uuid":"336842328","full_name":"gmum/LoCondA","owner":"gmum","description":"The official implementation of the \"Modeling 3D Surface Manifolds with a Locally Conditioned Atlas\" paper","archived":false,"fork":false,"pushed_at":"2021-03-23T23:27:05.000Z","size":62,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-28T12:44:38.241Z","etag":null,"topics":["3d-point-clouds","hypernetworks","meshes"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2102.05984","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/gmum.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":"2021-02-07T17:09:43.000Z","updated_at":"2023-03-23T21:10:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"cc4edb21-e64c-4d24-980c-ffa40eb886b5","html_url":"https://github.com/gmum/LoCondA","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/gmum%2FLoCondA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmum%2FLoCondA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmum%2FLoCondA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmum%2FLoCondA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gmum","download_url":"https://codeload.github.com/gmum/LoCondA/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248986279,"owners_count":21194025,"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":["3d-point-clouds","hypernetworks","meshes"],"created_at":"2025-03-11T23:50:29.705Z","updated_at":"2025-04-15T00:50:38.813Z","avatar_url":"https://github.com/gmum.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Modeling 3D Surface Manifolds with a Locally Conditioned Atlas (LoCondA) [[ Paper ]](https://arxiv.org/abs/2102.05984)\n\n## Requirements\n- dependencies stored in `requirements.txt`.\n- Python 3.6+\n- cuda\n\n## PointFlow dataset\nPointFlow dataset used in experiments was published [here](https://drive.google.com/drive/folders/1G0rf-6HSHoTll6aH7voh-dXj6hCRhSAQ?usp=sharing) by [PointFlow : 3D Point Cloud Generation with Continuous Normalizing Flows. Guandao Yang*, Xun Huang*, Zekun Hao, Ming-Yu Liu, Serge Belongie, Bharath Hariharan](https://arxiv.org/abs/1906.12320)\n\n## Installation\nIf you are using `Conda`:\n- run `./install_requirements.sh` \n\notherwise:\n- install `cudatoolkit` and run `pip install -r requirements.txt`\n\nThen execute:\n```\nexport CUDA_HOME=... # e.g. /var/lib/cuda-10.0/\n./build_losses.sh\n```\n\n#### Watertightness measure\n```\ngit submodule update --init --recursive\ncd pytorch-watertightness\nmake\n```\n\n\n### Configuration (settings/hyperparams.json, settings/experiments.json):\n  - HyperCloud\n    - *target_network_input:normalization:type* -\u003e progressive\n    - *target_network_input:normalization:epoch* -\u003e epoch for which the progressive normalization, of the points from uniform distribution, ends\n  - LoCondA\n    - *LoCondA:use_AtlasNet_TN* -\u003e use core AtlasNet ([AtlasNet: A Papier-Mâché Approach to Learning 3D Surface Generation](https://arxiv.org/abs/1802.05384)) function with input size changed from 2 to 5 as Target Network, otherwise HyperCloud Target Network will be used\n    - *LoCondA:reconstruction_points* (optional) -\u003e number of points reconstructed by HyperCloud Target Network\n    - regularization of the length of the patch edges (at most one regularization can be enabled):\n      - *LoCondA:edge_length_regularization*\n      - *LoCondA:regularize_normal_deviations*\n    - number of patch points:\n      - *LoCondA:grain* ^ 2 -\u003e if regularization is not enabled\n      - *LoCondA:edge_length_regularization:grain* ^ 2 -\u003e if edge_length_regularization is enabled\n      - *LoCondA:regularize_normal_deviations:grain* ^ 2 -\u003e if regularize_normal_deviations is enabled\n  - *reconstruction_loss* -\u003e chamfer | earth_mover\n  - *dataset* -\u003e shapenet | pointflow\n\n\n#### Frequency of saving training data (settings/hyperparams.json)\n```\n\"save_weights_frequency\": int (\u003e 0) -\u003e save model's weights every x epochs\n\"save_samples_frequency\": int (\u003e 0) -\u003e save intermediate reconstructions every x epochs\n```\n\n\n### HyperCloud Target Network input\n#### Uniform distribution:\n3D points are sampled from uniform distribution. \n\n##### Normalization\nWhen normalization is enabled, points are normalized progressively \nfrom first epoch to `target_network_input:normalization:epoch` epoch specified in the configuration. \n\nAs a result, for epochs \u003e= `target_network_input:normalization:epoch`, target network input is sampled from a uniform unit 3D ball \n\nExemplary config:\n```\n\"target_network_input\": {\n    \"constant\": false,\n    \"normalization\": {\n        \"enable\": true,\n        \"type\": \"progressive\",\n        \"epoch\": 100\n    }\n}\nFor epochs: [1, 100] target network input is normalized progressively\nFor epochs: [100, inf] target network input is sampled from a uniform unit 3D ball\n``` \n\n\n## Usage\n**Add project root directory to PYTHONPATH**\n\n```export PYTHONPATH=project_path:$PYTHONPATH```\n\n### Training\n\n#### HyperCloud\n- `python experiments/train_HyperCloud.py --config settings/hyperparams.json`\n\nResults will be saved in the directory: `${results_root}/vae/training/uniform*/${dataset}/${classes}`\n\n#### LoCondA\n- `python experiments/train_LoCondA.py --config settings/hyperparams.json`\n\nResults will be saved in the directory: \n\n`${results_root}/vae/atlas_training[_atlas_net_tn][_edge_length_regularization|_regularize_normal_deviations]/uniform*/${dataset}/${classes}`\n\n- `atlas_net_tn` will be added to results path if `use_AtlasNet_TN == True`\n- `_edge_length_regularization` will be added to results path if `edge_length_regularization` is enabled\n- `_regularize_normal_deviations` will be added to results path if `regularize_normal_deviations` is enabled\n\nHyperCloud model weights are loaded from path: `${results_root}/${arch}/training/.../weights`\n\n**use the same configuration file `settings/hyperparams.json` for both trainings**\n\n\n### Experiments\n`python experiments/experiments.py --config settings/experiments.json`\n\nResults will be saved in the directory: \n\n`${results_root}/vae/atlas_experiments[_atlas_net_tn][_edge_length_regularization|_regularize_normal_deviations]/uniform*/${dataset}/${classes}`\n\nHyperCloud model weights are loaded from path: `${results_root}/${arch}/training/.../weights`\n\nLoCondA model weights are loaded from path: `${results_root}/${arch}/atlas_training.../weights`\n\n(make sure that `target_network_input`, `classes`, `use_AtlasNet_TN`, `regularization`, `model` are the same in the `hyperparams.json`/`experiments.json`)\n\n\n### Configuration settings/experiments.json\n\n\n##### sphere_triangles_points\nProvide input of the HyperCloud Target Network as samples from a triangulation of a unit 3D sphere.\n\n3D points are sampled uniformly from the triangulation of the unit 3D sphere.\n\nAvailable methods: `hybrid | hybrid2 | hybrid3 | midpoint | midpoint2 | centroid | edge`. \n\nIf enabled, `image_points` will be replaced.\n\n\n##### square_mesh\nProvide input of the LoCondA Target Network as samples from a triangulation of a regular grid (square).\n\nThe patch and its edges will be generated from triangulation of the square (square mesh).\n\nIf enabled, `patch_points` will be replaced with `grain ^ 2`.\n\nExperiments return the following files for each point cloud:\n- `triangulation.pickle` - triangulation of the unit 3D sphere if `sphere_triangles_points` is enabled\n- `real.npy` - original point cloud\n- `reconstructed.npy` - reconstructed point cloud by HyperCloud Target Network\n- `atlas.npy` - patches `image_points x patch_points x 3` \n- `atlas_triangulation.npy` - connections of a patch vertices if `square_mesh` is enabled\n\n\n### Testing\n\n\n#### Compute Metrics - JSD, MMD, COV (as in PointFlow)\n`python experiments/compute_metrics.py --config settings/experiments.json`\n\n\n#### Compute Mesh Metrics - Watertightness\n```\npython experiments/compute_mesh_metrics.py\nArguments:\n--shapenet SHAPENET     Path to the directory with ShapeNetCore.v2 meshes\n--to_compare TO_COMPARE [TO_COMPARE ...]\n                        Multiple paths to different folders where\n                        reconstructed meshes are located\n--classes CLASSES [CLASSES ...]\n                        Classes to be used to compare\n\nExample of usage: python experiments/compute_mesh_metrics.py --shapenet /Datasets/ShapeNetCore.v2/ --to_compare /reconstructions/meshes/ --classes airplane car chair\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmum%2Floconda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgmum%2Floconda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmum%2Floconda/lists"}