Package: deeplabcut-live-gui
DeepLabCut-Live! GUIGUI to runDeepLabCut-liveon a video feed, record videos, and record external timestamps.Installation InstructionsGetting StartedOpen DeepLabCut-live-GUIIn a terminal, activate the conda or virtual environment where DeepLabCut-live-GUI is installed, then run:dlcliveguiConfigurationsFirst, create a configuration file: select the drop down menu labeledConfig, and clickCreate 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 CamerasTo setup a new camera, selectAdd Camerafrom the dropdown menu, and then clickInit Cam. This will be bring up a new window where you need to select the type of camera (seeCamera Support), input a name for the camera, and clickAdd Camera. This will initialize a newCameraentry in the drop down menu. Now, select your camera from the dropdown menu and clickEdit Camera Settingsto 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, clickInit Camto start streaming. To stop streaming data, clickClose Camera, and to remove a camera from the dropdown menu, clickRemove Camera.Processor (optional)To write customProcessors, please seehere. The directory that contains your customProcessorshould be a python module -- this directory must contain an__init__.pyfile that imports your customProcessor. For examples of how to structure a customProcessordirectory, please seehere.To use your processor in the GUI, you must first add your customProcessordirectory to the dropdown menu: next to theProcessor Dirlabel, clickBrowse, and select your customProcessordirectory. Next, select the desired directory from theProcessor Dirdropdown menu, then select theProcessoryou would like to use from theProcessormenu. If you would like to edit the arguments for your processor, please selectEdit Proc Settings, and finally, to use the processor, clickSet Proc. If you have previously set aProcessorand would like to clear it, clickClear Proc.Configure DeepLabCut NetworkSelect theDeepLabCutdropdown menu, and clickAdd 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, clickUpdateto add this DeepLabCut configuration to the dropdown menu. You can edit the settings at any time by clickingEdit DLC Settings. Once configured, you can load the network and start performing inference by clickingStart DLC. If you would like to view the DeepLabCut pose estimation in real-time, selectDisplay DLC Keypoints. You can edit the keypoint display settings (the color scheme, size of points, and the likelihood threshold for display) by selectingEdit DLC Display Settings.If you want to stop performing inference at any time, just clickStop DLC, and if you want to remove a DeepLabCut configuration from the dropdown menu, clickRemove DLC.Set Up SessionSessions are defined by the subject name, the date, and an attempt number. Within the GUI, select aSubjectfrom the dropdown menu, or to add a new subject, type the new subject name in to the entry box and clickAdd Subject. Next, select anAttemptfrom the dropdown menu. Then, select the directory that you would like to save data to from theDirectorydropdown menu. To add a new directory to the dropdown menu, clickBrowse. Finally, clickSet Up Sessionto initiate a new recording. This will prepare the GUI to save data. Once you clickSet Up Session, theReadybutton should turn blue, indicating a session is ready to record.Controlling RecordingIf theReadybutton is selected, you can now start a recording by clickingOn. TheOnbutton will then turn green indicating a recording is active. To stop a recording, clickOff. This will cause theReadybutton 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, clickSave Videoto 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 theProcessorin 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 theDirectorydropdown menu.CAMERA NAME : the name of selected camera (from theCameradropdown menu).SUBJECT : the subject chosen from theSubjectdrowdown menu.DATE : the current date of the experiment.ATTEMPT : the attempt number chosen from theAttemptdropdown.If you would not like to save the data from the session, please clickDelete Video, and all data will be discarded. After you clickSave VideoorDelete Video, theOffbutton will be selected, indicating you can now set up a new session.References:If you use this code we kindly ask you to you pleasecite Kane et al, eLife 2020. The preprint is available here:https://www.biorxiv.org/content/10.1101/2020.08.04.236422v2