{"id":49846926,"url":"https://github.com/yhisaki/wandb-cpp","last_synced_at":"2026-05-14T12:45:38.961Z","repository":{"id":136920084,"uuid":"392738634","full_name":"yhisaki/wandb-cpp","owner":"yhisaki","description":"C++ visualizing and tracking library built on the wandb","archived":false,"fork":false,"pushed_at":"2024-06-30T04:14:39.000Z","size":1610,"stargazers_count":19,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-07-01T03:31:49.199Z","etag":null,"topics":["cpp","wandb"],"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/yhisaki.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-08-04T15:26:23.000Z","updated_at":"2024-06-30T04:14:42.000Z","dependencies_parsed_at":"2024-02-03T09:39:24.266Z","dependency_job_id":null,"html_url":"https://github.com/yhisaki/wandb-cpp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yhisaki/wandb-cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhisaki%2Fwandb-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhisaki%2Fwandb-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhisaki%2Fwandb-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhisaki%2Fwandb-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yhisaki","download_url":"https://codeload.github.com/yhisaki/wandb-cpp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhisaki%2Fwandb-cpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33026038,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","wandb"],"created_at":"2026-05-14T12:45:38.182Z","updated_at":"2026-05-14T12:45:38.915Z","avatar_url":"https://github.com/yhisaki.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/wandb/wandb/main/assets/logo-dark.svg#gh-dark-mode-only\" width=\"600\" alt=\"Weights \u0026 Biases\" /\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/wandb/wandb/main/assets/logo-light.svg#gh-light-mode-only\" width=\"600\" alt=\"Weights \u0026 Biases\" /\u003e\n\u003c/p\u003e\n\n\n# WandB-CPP\n\nUnofficial C++ binding for [Weight \u0026 Biases](https://wandb.ai/site).\n\n## Installation\n\nwandb-cpp works by wrapping the [Weight \u0026 Biases](https://wandb.ai/site).So, you need to install wandb according to [this procedure](https://docs.wandb.ai/quickstart) first.\n\n```bash\npip install wandb\n```\n\nThe required Python packages are listed in the requirements.txt file.\n\n## Usage\n\n### Basic Usage\n\nExecution result is [here](https://wandb.ai/hisaki/example_wandb_cpp/runs/2runz37w)!\n\n```cpp\n#include \u003ccmath\u003e\n#include \u003ciostream\u003e\n\n#include \"wandbcpp.hpp\"\n\nint main() {\n  wandbcpp::init({.project = \"example_wandb_cpp\", .tags = {\"basic\"}});\n\n  int N = 100;\n\n  wandbcpp::update_config({{\"N\", N}, {\"mode\", \"abc\"}});\n\n  for (int i = 0; i \u003c N; i++) {\n    double t = M_PI * i / N;\n    double x = std::sin(M_PI * i / N);\n    double y = std::cos(M_PI * i / N);\n    wandbcpp::log({{\"t\", t}, {\"x\", x}, {\"y\", y}});\n    std::cout \u003c\u003c \"i : \" \u003c\u003c i \u003c\u003c std::endl;\n  }\n\n  wandbcpp::finish();\n}\n```\n![result](assets/example_log_basic.png)\n\n### Upload Image\n\nExecution result is [here](https://wandb.ai/hisaki/example_wandb_cpp/runs/g5lgkjja)!\n\n```cpp\n#include \u003copencv2/opencv.hpp\u003e\n#include \"wandbcpp.hpp\"\n\nint main()\n{\n  wandbcpp::init({.project = \"example_wandb_cpp\", .tags = {\"image\"}});\n  cv::Mat img = cv::imread(\"examples/data/lena.png\");\n  wandbcpp::log({{\"image_from_array\", wandbcpp::Image(img)}});\n  wandbcpp::log(\n      {{\"image_from_path\", wandbcpp::Image(\"examples/data/lena.png\")}});\n  wandbcpp::finish();\n}\n```\n\n![result](assets/example_image.png)\n\n### Upload Video\n\nExecution result is [here](https://wandb.ai/hisaki/example_wandb_cpp/runs/t23edtdv)!\n\n```cpp\n#include \u003copencv2/opencv.hpp\u003e\n#include \"wandbcpp.hpp\"\n\nint main() {\n  cv::VideoCapture cap(\"examples/data/parrot.mp4\");\n\n  if (!cap.isOpened()) {\n    std::cerr \u003c\u003c \"Error: Video file not opened.\" \u003c\u003c std::endl;\n    return 1;\n  }\n\n  std::vector\u003ccv::Mat\u003e frames;\n\n  while (true) {\n    cv::Mat frame;\n    cap \u003e\u003e frame;\n    if (frame.empty()) break;\n\n    frames.push_back(frame);\n  }\n  std::cout \u003c\u003c \"Number of frames: \" \u003c\u003c frames.size() \u003c\u003c std::endl;\n\n  wandbcpp::init({.project = \"example_wandb_cpp\", .tags = {\"video\"}});\n\n  wandbcpp::log({{\"video\", wandbcpp::Video(frames.begin(), frames.end())}});\n\n  wandbcpp::finish();\n}\n```\n\n![result](assets/example_video.gif)\n\n### Save File\n\nExecution result is [here](https://wandb.ai/hisaki/example_wandb_cpp/runs/1g5qxcfh)!\n\n```cpp\n#include \"wandbcpp.hpp\"\n\nint main() {\n  wandbcpp::init({.project = \"example_wandb_cpp\", .tags = {\"save file\"}});\n  wandbcpp::save(\"examples/data/lena.png\");  // save this source code\n  wandbcpp::finish();\n}\n```\n\n![result](assets/example_save_file.png)\n\n### wandb.Table\n\n- use `add_data`\n\n  Execution result is [here](https://wandb.ai/hisaki/example_wandb_cpp/runs/2m6djvut)!\n\n  ```cpp\n  #include \u003ccmath\u003e\n\n  #include \"wandbcpp.hpp\"\n\n  int main() {\n    wandbcpp::init({.project = \"example_wandb_cpp\", .tags = {\"table\"}});\n    int I = 10;\n    int J = 100;\n\n    for (int i = 0; i \u003c I; i++) {\n      wandbcpp::Table table({\"x\", \"y\"});\n      for (int j = 0; j \u003c J; j++) {\n        double x = (i + 1) * std::sin(M_PI * j / J);\n        double y = (i + 1) * std::cos(M_PI * j / J);\n        table.add_data({x, y});\n      }\n      wandbcpp::log({{\"mytable\", table}});\n    }\n    wandbcpp::finish();\n  }\n  ```\n  ![result](assets/example_table_add_data.png)\n\n- use `add_column`\n\n  Execution result is [here](https://wandb.ai/hisaki/example_wandb_cpp/runs/3ijm1cne)!\n\n  ```cpp\n  #include \"wandbcpp.hpp\"\n\n  int main() {\n    wandbcpp::init({.project = \"example_wandb_cpp\", .tags = {\"table\"}});\n    wandbcpp::Table table;\n    std::vector\u003cdouble\u003e x = {1.0, 2.0, 3.0};\n    std::vector\u003cint\u003e y = {4, 5, 6};\n    table.add_column(\"x\", {x.begin(), x.end()});\n    table.add_column(\"y\", {y.begin(), y.end()});\n    wandbcpp::log({{\"table\", table}});\n    wandbcpp::finish();\n  }\n  ```\n\n  ![result](assets/example_table_add_column.png)\n\n- passing data in the constructor\n\n  Execution result is [here](https://wandb.ai/hisaki/example_wandb_cpp/runs/liy6u81n)!\n\n  ```cpp\n  #include \"wandbcpp.hpp\"\n\n  int main() {\n    wandbcpp::init({.project = \"example_wandb_cpp\", .tags = {\"table\"}});\n    int I = 10;\n    for (int i = 0; i \u003c I; i++) {\n      wandbcpp::Table table({\"x\", \"y\"}, {{\"poyo\", i}, {\"hoge\", i + 1}});\n      wandbcpp::log({{\"table\", table}});\n    }\n    wandbcpp::finish();\n  }\n  ```\n\n  ![result](assets/example_table_constructor.png)\n\n### wandb.Object3D\n\n- plot pointcloud\n\n  Execution result is [here](https://wandb.ai/hisaki/example_wandb_cpp/runs/8o6pb0jn)!\n\n  ```cpp\n  #include \u003carray\u003e\n  #include \u003crandom\u003e\n\n  #include \"wandbcpp.hpp\"\n\n  std::array\u003cdouble, 3\u003e gen_random_point() {\n    static std::random_device seed_gen;\n    static std::mt19937 engine(seed_gen());\n    static std::uniform_real_distribution\u003c\u003e dist(-1.0, 1.0);\n    return {dist(engine), dist(engine), dist(engine)};\n  }\n\n  int main() {\n    namespace np = wandbcpp::numpy;\n\n    wandbcpp::init({.project = \"example_wandb_cpp\", .tags = {\"object3d\"}});\n\n    int num_points = 300;\n\n    std::vector\u003cstd::array\u003cdouble, 3\u003e\u003e point_cloud(num_points);\n\n    std::generate(point_cloud.begin(), point_cloud.end(), \u0026gen_random_point);\n\n    auto lst = wandbcpp::topylist(point_cloud.begin(), point_cloud.end());\n\n    wandbcpp::log({{\"obj3d\", wandbcpp::Object3D{np::ndarray{lst}}}});\n\n    wandbcpp::finish();\n\n    return 0;\n  }\n  ```\n\n  ![result](assets/example_object3d_pointcloud.png)\n\n## Build examples\n\n```\nmkdir build \u0026\u0026 cd build\ncmake -D BUILD_WANDBCPP_EXE=ON ..\nmake\n```\n\n### CMake options\n\n- `BUILD_WANDBCPP_EXE` : Build examples. Default is `OFF`.\n- `USE_OPENCV` : To save image, use OpenCV. Default is `OFF`.\n\n## Implementation \u0026 Performance\n\nThis library executes most of its operations in multi-threaded mode. Therefore, this library should have little impact on the performance of the main processing.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyhisaki%2Fwandb-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyhisaki%2Fwandb-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyhisaki%2Fwandb-cpp/lists"}