{"id":24483720,"url":"https://github.com/shineiarakawa/diffusion-model-cpp","last_synced_at":"2025-03-14T20:27:18.881Z","repository":{"id":244175777,"uuid":"813547552","full_name":"ShineiArakawa/diffusion-model-cpp","owner":"ShineiArakawa","description":"A C++ implementation of a diffusion model using libtorch.","archived":false,"fork":false,"pushed_at":"2024-06-14T11:52:02.000Z","size":494,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-21T13:12:09.631Z","etag":null,"topics":["cpp","diffusion-models","libtorch"],"latest_commit_sha":null,"homepage":"","language":"C++","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/ShineiArakawa.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-06-11T09:34:41.000Z","updated_at":"2024-12-12T23:18:12.000Z","dependencies_parsed_at":"2024-06-13T09:07:36.635Z","dependency_job_id":"0c26677c-c645-4f3c-ad4e-54ad9bda0c4f","html_url":"https://github.com/ShineiArakawa/diffusion-model-cpp","commit_stats":null,"previous_names":["shineiarakawa/diffusion-model-cpp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShineiArakawa%2Fdiffusion-model-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShineiArakawa%2Fdiffusion-model-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShineiArakawa%2Fdiffusion-model-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShineiArakawa%2Fdiffusion-model-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShineiArakawa","download_url":"https://codeload.github.com/ShineiArakawa/diffusion-model-cpp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243641283,"owners_count":20323821,"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":["cpp","diffusion-models","libtorch"],"created_at":"2025-01-21T13:12:13.295Z","updated_at":"2025-03-14T20:27:18.841Z","avatar_url":"https://github.com/ShineiArakawa.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# diffusion-model-cpp\u003cbr\u003e\u003csub\u003eA C++ implementation of a diffusion model using libtorch\u003c/sub\u003e\n\n![Teaser image](./assets/sampled_images.png)\n\n## Features\n- Diffusion model implemented using libtorch\n- Support for training and ~~inference~~\n- Customizable parameters for training and model configuration\n- Pure C++ implementation\n\n## Tested environments\n- C++17\n- GCC 11.4.0\n- CMake 3.30\n- libtorch 2.1.0\n- OpenCV 4.7.0 (for image processing)\n- CUDAToolkit 12.3\n\n## Getting Started\n\n### Build\n1. Clone the repository:\n    ```sh\n    git clone --recursive https://github.com/your_username/diffusion-model-cpp.git\n    cd diffusion-model-cpp\n    ```\n\n2. Install dependencies:\n    ```sh\n    sudo apt-get update\n    sudo apt-get install libopencv-dev\n    ```\n\n3. Download and extract libtorch:\n    ```sh\n    wget https://download.pytorch.org/libtorch/cu121/libtorch-cxx11-abi-shared-with-deps-2.3.1%2Bcu121.zip\n    unzip libtorch-cxx11-abi-shared-with-deps-2.3.1+cu121.zip\n    ```\n\n4. Build the project using CMake:\n    ```sh\n    mkdir build\n    cd build\n    cmake -DCMAKE_PREFIX_PATH=/path/to/libtorch ..\n    make\n    ```\n\n### Training\n1. Prepare your dataset and update the dataset path and log dir path in the configuration file `configs/sample.json`.\n\n2. Run the training program:\n    ```sh\n    ./build/src/train configs/sample.json\n    ```\n\n3. The model and training logs will be saved in the log directory.\n\n## Acknowledgements\n- This project uses [libtorch](https://pytorch.org/cppdocs/) for implementing the diffusion model.\n- OpenCV is used for image processing tasks.\n- Inspiration and algorithms are based on recent research in the field of [diffusion models](https://github.com/crowsonkb/k-diffusion).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshineiarakawa%2Fdiffusion-model-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshineiarakawa%2Fdiffusion-model-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshineiarakawa%2Fdiffusion-model-cpp/lists"}