Skip to main content

GUI to run real time deeplabcut experiments

Project description

DeepLabCut-Live! GUI DLC LIVE! GUI

Code style: black PyPI - Python Version PyPI - Downloads Python package

License Image.sc forum Gitter Twitter Follow

GUI to run DeepLabCut-live on a video feed, record videos, and record external timestamps.

Installation Instructions

Getting Started

Open DeepLabCut-live-GUI

In a terminal, activate the conda or virtual environment where DeepLabCut-live-GUI is installed, then run:

dlclivegui

Configurations

First, create a configuration file: select the drop down menu labeled Config, and click Create New Config. All settings, such as details about cameras, DLC networks, and DLC-live Processors, will be saved into configuration files so that you can close and reopen the GUI without losing all of these details. You can create multiple configuration files on the same system, so that different users can save different camera options, etc on the same computer. To load previous settings from a configuration file, please just select the file from the drop-down menu. Configuration files are stored at $HOME/Documents/DeepLabCut-live-GUI/config. These files do not need to be edited manually, they can be entirely created and edited automatically within the GUI.

Set Up Cameras

To setup a new camera, select Add Camera from the dropdown menu, and then click Init Cam. This will be bring up a new window where you need to select the type of camera (see Camera Support), input a name for the camera, and click Add Camera. This will initialize a new Camera entry in the drop down menu. Now, select your camera from the dropdown menu and clickEdit Camera Settings to setup your camera settings (i.e. set the serial number, exposure, cropping parameters, etc; the exact settings depend on the specific type of camera). Once you have set the camera settings, click Init Cam to start streaming. To stop streaming data, click Close Camera, and to remove a camera from the dropdown menu, click Remove Camera.

Processor (optional)

To write custom Processors, please see here. The directory that contains your custom Processor should be a python module -- this directory must contain an __init__.py file that imports your custom Processor. For examples of how to structure a custom Processor directory, please see here.

To use your processor in the GUI, you must first add your custom Processor directory to the dropdown menu: next to the Processor Dir label, click Browse, and select your custom Processor directory. Next, select the desired directory from the Processor Dir dropdown menu, then select the Processor you would like to use from the Processor menu. If you would like to edit the arguments for your processor, please select Edit Proc Settings, and finally, to use the processor, click Set Proc. If you have previously set a Processor and would like to clear it, click Clear Proc.

Configure DeepLabCut Network

Select the DeepLabCut dropdown menu, and click Add DLC. This will bring up a new window to choose a name for the DeepLabCut configuration, choose the path to the exported DeepLabCut model, and set DeepLabCut-live settings, such as the cropping or resize parameters. Once configured, click Update to add this DeepLabCut configuration to the dropdown menu. You can edit the settings at any time by clicking Edit DLC Settings. Once configured, you can load the network and start performing inference by clicking Start DLC. If you would like to view the DeepLabCut pose estimation in real-time, select Display DLC Keypoints. You can edit the keypoint display settings (the color scheme, size of points, and the likelihood threshold for display) by selecting Edit DLC Display Settings.

If you want to stop performing inference at any time, just click Stop DLC, and if you want to remove a DeepLabCut configuration from the dropdown menu, click Remove DLC.

Set Up Session

Sessions are defined by the subject name, the date, and an attempt number. Within the GUI, select a Subject from the dropdown menu, or to add a new subject, type the new subject name in to the entry box and click Add Subject. Next, select an Attempt from the dropdown menu. Then, select the directory that you would like to save data to from the Directory dropdown menu. To add a new directory to the dropdown menu, click Browse. Finally, click Set Up Session to initiate a new recording. This will prepare the GUI to save data. Once you click Set Up Session, the Ready button should turn blue, indicating a session is ready to record.

Controlling Recording

If the Ready button is selected, you can now start a recording by clicking On. The On button will then turn green indicating a recording is active. To stop a recording, click Off. This will cause the Ready button to be selected again, as the GUI is prepared to restart the recording and to save the data to the same file. If you're session is complete, click Save Video to save all files: the video recording (as .avi file), a numpy file with timestamps for each recorded frame, the DeepLabCut poses as a pandas data frame (hdf5 file) that includes the time of each frame used for pose estimation and the time that each pose was obtained, and if applicable, files saved by the Processor in use. These files will be saved into a new directory at {YOUR_SAVE_DIRECTORY}/{CAMERA NAME}_{SUBJECT}_{DATE}_{ATTEMPT}

  • YOUR_SAVE_DIRECTORY : the directory chosen from the Directory dropdown menu.
  • CAMERA NAME : the name of selected camera (from the Camera dropdown menu).
  • SUBJECT : the subject chosen from the Subject drowdown menu.
  • DATE : the current date of the experiment.
  • ATTEMPT : the attempt number chosen from the Attempt dropdown.

If you would not like to save the data from the session, please click Delete Video, and all data will be discarded. After you click Save Video or Delete Video, the Off button will be selected, indicating you can now set up a new session.

References:

If you use this code we kindly ask you to you please cite Kane et al, eLife 2020. The preprint is available here: https://www.biorxiv.org/content/10.1101/2020.08.04.236422v2

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deeplabcut-live-gui-1.0.tar.gz (35.1 kB view details)

Uploaded Source

Built Distribution

deeplabcut_live_gui-1.0-py3-none-any.whl (55.1 kB view details)

Uploaded Python 3

File details

Details for the file deeplabcut-live-gui-1.0.tar.gz.

File metadata

  • Download URL: deeplabcut-live-gui-1.0.tar.gz
  • Upload date:
  • Size: 35.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.5

File hashes

Hashes for deeplabcut-live-gui-1.0.tar.gz
Algorithm Hash digest
SHA256 9f7727ab555307c8f88bfbd3facc8cdfe2e050028672caa40ccf027ffce7c1e0
MD5 8ca8bc6869c9b48442d3b77330824bee
BLAKE2b-256 343335d2293bb4d0d0695bf269732f0ad1ab1111732ae8c413b7668dd9735d67

See more details on using hashes here.

File details

Details for the file deeplabcut_live_gui-1.0-py3-none-any.whl.

File metadata

  • Download URL: deeplabcut_live_gui-1.0-py3-none-any.whl
  • Upload date:
  • Size: 55.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.5

File hashes

Hashes for deeplabcut_live_gui-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc7470917f98d9f65e88b58f0348eb19fa634842a7b931e5059c8dd78a18c8fd
MD5 a3ceaf20a8460a44c6f1f03d172007a6
BLAKE2b-256 917a4a637e869cab15f24570956b647a4e7f5838bb6d4bc26b4d345383fea3e8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page