{"id":18611743,"url":"https://github.com/deeplabcut/dlc2nwb","last_synced_at":"2025-04-10T23:31:00.161Z","repository":{"id":43355774,"uuid":"414218678","full_name":"DeepLabCut/DLC2NWB","owner":"DeepLabCut","description":"Utilities to convert DeepLabCut (DLC), output to/from Neurodata Without Borders (NWB) format. ","archived":false,"fork":false,"pushed_at":"2024-06-19T18:22:29.000Z","size":310,"stargazers_count":14,"open_issues_count":6,"forks_count":7,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-25T06:09:15.617Z","etag":null,"topics":["deeplabcut","nwb","nwb-format"],"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/DeepLabCut.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-10-06T13:15:45.000Z","updated_at":"2024-08-19T08:21:33.000Z","dependencies_parsed_at":"2023-02-14T20:25:34.817Z","dependency_job_id":null,"html_url":"https://github.com/DeepLabCut/DLC2NWB","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepLabCut%2FDLC2NWB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepLabCut%2FDLC2NWB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepLabCut%2FDLC2NWB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepLabCut%2FDLC2NWB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DeepLabCut","download_url":"https://codeload.github.com/DeepLabCut/DLC2NWB/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248315953,"owners_count":21083351,"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":["deeplabcut","nwb","nwb-format"],"created_at":"2024-11-07T03:14:41.762Z","updated_at":"2025-04-10T23:30:59.653Z","avatar_url":"https://github.com/DeepLabCut.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Welcome to the DeepLabCut 2 Neurodata Without Borders Repo\n\nHere we provide utilities to convert [DeepLabCut (DLC)](https://github.com/DeepLabCut/DeepLabCut) output to/from [Neurodata Without Borders (NWB) format](https://www.nwb.org/nwb-neurophysiology/). This repository also elaborates a way for how pose estimation data should be represented in NWB.\n\nSpecifically, this package allows you to convert DLC's predictions on videos (*.h5 files) into NWB format. This is best explained with an example (see below).\n\n# NWB pose ontology\n\nThe standard is presented [here](https://github.com/rly/ndx-pose). Our code is based on this NWB extension (PoseEstimationSeries, PoseEstimation) that was developed with [Ben Dichter, Ryan Ly and Oliver Ruebel](https://www.nwb.org/team/).\n\n# Installation:\n\nSimply do (it only depends on `ndx-pose` and `deeplabcut`):\n\n`pip install dlc2nwb`\n\n# Example within DeepLabCut\n\nDeepLabCut's h5 data files can be readily converted to NWB format either via the GUI from the `Analyze Videos` tab or programmatically, as follows:\n\n```python\nimport deeplabcut\n\ndeeplabcut.analyze_videos_converth5_to_nwb(config_path, video_folder)\n```\nNote that DLC does not strictly depend on dlc2nwb just yet; if attempting to convert to NWB, a user would be asked to run `pip install dlc2nwb`.\n\n# Example use case of this package (directly):\n\nHere is an example for converting DLC data to NWB format (and back). Notice you can also export your data directly from DeepLabCut.\n\n```\nfrom dlc2nwb.utils import convert_h5_to_nwb, convert_nwb_to_h5\n\n# Convert DLC -\u003e NWB:\nnwbfile = convert_h5_to_nwb(\n    'examples/config.yaml',\n    'examples/m3v1mp4DLC_resnet50_openfieldAug20shuffle1_30000.h5',\n)\n\n# Convert NWB -\u003e DLC\ndf = convert_nwb_to_h5(nwbfile[0])\n```\n\nExample data to run the code is provided in the folder [examples](/examples). The data is based on a DLC project you can find on [Zenodo](https://zenodo.org/record/4008504#.YWhD7NOA4-R) and that was originally presented in [Mathis et al., Nat. Neuro](https://www.nature.com/articles/s41593-018-0209-y) as well as [Mathis et al., Neuron](https://www.sciencedirect.com/science/article/pii/S0896627320307170?via%3Dihub). To limit space, the folder only contains the project file `config.yaml` and DLC predictions for an example video called `m3v1mp4.mp4`, which are stored in `*.h5` format. The video is available, [here](https://github.com/DeepLabCut/DeepLabCut/tree/master/examples/openfield-Pranav-2018-10-30/videos).\n\n\n# Funding and contributions:\n\nWe gratefully acknowledge the generous support from the [Kavli Foundation](https://kavlifoundation.org/) via a [Kavli Neurodata Without Borders Seed Grants\n](https://www.nwb.org/nwb-seed-grants/).\n\nWe also acknowledge feedback, and our collaboration with [Ben Dichter, Ryan Ly and Oliver Ruebel](https://www.nwb.org/team/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeeplabcut%2Fdlc2nwb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeeplabcut%2Fdlc2nwb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeeplabcut%2Fdlc2nwb/lists"}