dlclib

a wrapper of DeepLabCut for its ease of use.

https://github.com/gwappa/python-dlclib

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 5 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.4%) to scientific vocabulary
Last synced: 6 months ago · JSON representation

Repository

a wrapper of DeepLabCut for its ease of use.

Basic Info
  • Host: GitHub
  • Owner: gwappa
  • License: mit
  • Language: Python
  • Default Branch: master
  • Size: 17.6 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created almost 6 years ago · Last pushed about 5 years ago
Metadata Files
Readme License

README.md

python-dlclib

DOI

A wrapper of DeepLabCut for its ease of use.

dlclib is supposed to work with almost all single-camera setups of all DLC versions.

Installation

It is better building your DeepLabCut environment first, before running:

bash $ pip install dlclib

Classes

dlclib.estimate.TFSession

A thin wrapper over the DeepLabCut inference network based on TensorFlow.

  • session = TFSession.from_config(cfg) will return a TFSession object using the specified config.yaml file of the DeepLabCut project.
  • session.get_pose(image) will return a numpy.ndarray corresponding to the estimation. for a batch-processing network, use a list of images, or a 4-D uint8 array whose axis 0 correspond to indexes of images.
  • session.open_writer(path) opens a CSVWriter at the specified path (see below).

dlclib.posture.PostureMapper

A utility class that maps the output of TFSession to a dictionary. Note that the current implementation:

  • does not care anything about conversion speed.
  • currently only supports non-batch models.

  • mapper = PostureMapper.from_config(cfg) will return a PostureMapper object using the specified config.yaml file of the DeepLabCut project.

  • posedict = mapper.map(pose) receives the output of TFSession.get_pose(), and returns a dictionary. posedict[part] is a named tuple that has x, y and prob attributes.

dlclib.writer.CSVWriter

A simple class for writing the estimation into a CSV file. This class does support batch-processing networks.

  • writer = session.open_writer(path) from a TFSession object initializes the writer associated with the inference session.
  • For every video frame, you can call writer.push(frame). It automatically calls TFSession.get_pose() internally, and writes its outputs into the file.
  • Calling writer.flush() will flush the pended video frames (in case of batch modes; it does not wait for more frames and runs get_pose() to writes the estimation).
  • Calling writer.close() will flush its internal buffer, close the file and invalidates itself. You can keep using the originating TFSession object.

This class supports the context-manager model, so you can write:

python with session.open_writer(path) as out: for frame in video_frames: out.push(frame)

License

2020-2021 Keisuke Sehara, the MIT License

You can cite dlclib by using the DOI: https://doi.org/10.5281/zenodo.4459238

Owner

  • Name: Keisuke Sehara
  • Login: gwappa
  • Kind: user
  • Location: Tokyo, Japan

a hard-core N.E.E.T. with some coding capabilities (C/C++, Java, Python, Rust) interested in automating chores without paying royalty.

GitHub Events

Total
Last Year

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 10
  • Total Committers: 1
  • Avg Commits per committer: 10.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Keisuke Sehara k****a@g****m 10

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 0
  • Total pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: less than a minute
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • gwappa (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 5 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 1
  • Total maintainers: 1
pypi.org: dlclib

a wrapper of DeepLabCut for its ease of use.

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 5 Last month
Rankings
Dependent packages count: 10.0%
Dependent repos count: 21.7%
Forks count: 29.8%
Average: 30.3%
Stargazers count: 38.8%
Downloads: 51.4%
Maintainers (1)
Last synced: 6 months ago

Dependencies

setup.py pypi
  • deeplabcut *