@@ -70,6 +70,44 @@ DIPLOMAT with DeepLabCut support by simply using pip, using one of the two comma
7070 # Install DIPLOMAT with DeepLabCut without UI support.
7171 pip install diplomat-track[dlc]
7272
73+ Troubleshooting for DIPLOMAT-DLC
74+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75+
76+ If the standard methods fail to install DIPLOMAT and DLC, you can install from
77+ the Github source code. This method requires `git <https://git-scm.com/downloads >`_, as well
78+ as Miniforge.
79+
80+ .. code-block :: sh
81+
82+ # Clone the DIPLOMAT repository and navigate into it.
83+ git clone https://github.com/TravisWheelerLab/DIPLOMAT
84+ cd DIPLOMAT
85+ # With Miniforge, create a Python 3.10 environment and activate it.
86+ conda create -n py310 python==3.10
87+ conda activate py310
88+ # Use the environment you just activated to create a virtual environment ("venv") containing Python 3.10.
89+ python -m venv venv
90+ # Fully deactivate the Miniforge environment.
91+ # (run the command twice)
92+ conda deactivate
93+ conda deactivate
94+ # Now, activate the virtual environment.
95+ # # On Windows, the first time you activate the venv, you may need to configure your execution policy.
96+ Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
97+ # # Activate the venv on Windows.
98+ venv/scripts/Activate
99+ # # Activate the venv on Mac/Linux.
100+ source venv/bin/activate
101+ # Finally, install DIPLOMAT and DLC. The installation may take several minutes to complete.
102+ python -m pip install -e .[dlc,gui] --ignore-installed
103+ # Verify that the installation was successful. The following command should output the current version number.
104+ diplomat --version
105+
106+ On Windows, if DIPLOMAT crashes with "OSError: [WinError 126]", you need the libomp DLL.
107+ Download the .zip from https://www.dllme.com/dll/files/libomp140_x86_64/versions, extract
108+ it, and copy the .dll file to the torch libraries folder of your virtual environment, which
109+ should be located at ``.\venv\lib\site-packages\torch\lib `` within the DIPLOMAT directory.
110+ If you named your virtual environment something other than ``venv ``, change the path accordingly.
73111
74112With Support for SLEAP Projects
75113^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -119,4 +157,75 @@ trying to install DIPLOMAT with SLEAP support on Windows, prefer using the mamba
119157 # Install DIPLOMAT with SLEAP with GUI support.
120158 pip install diplomat-track[sleap, gui]
121159 # Install DIPLOMAT with SLEAP without UI support.
122- pip install diplomat-track[sleap]
160+ pip install diplomat-track[sleap]
161+
162+ Troubleshooting for DIPLOMAT-SLEAP
163+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
164+
165+ If the Mamba method fails to install DIPLOMAT and SLEAP, you may need to downgrade the
166+ numpy version manually. Activate the mamba environment with ``mamba activate DIPLOMAT-SLEAP ``,
167+ then downgrade numpy with ``pip install numpy<1.23.0 ``.
168+
169+ Verifying the DIPLOMAT installation
170+ -----------------------------------
171+
172+ Downloading the Sample data
173+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
174+
175+ Sample models and a video are provided `on Zenodo <https://zenodo.org/records/14232002 >`_ for
176+ verifying the installation. Download the video clip `N5PZS.avi ` and the model corresponding to
177+ your installation (DLC_5bp.zip for DeepLabCut, SLEAP_5bp.zip for SLEAP.) Unzip the model. Your
178+ working directory should now contain both the video file `N5PZS.avi ` and the model folder, either
179+ `test_dlc_5/ ` or `test_sleap_5/ `. Verify that both are present by running ``ls ``.
180+
181+ Activating the environment
182+ ^^^^^^^^^^^^^^^^^^^^^^^^^^
183+
184+ Next, you will activate the environment for DIPLOMAT. Unless you installed with the
185+ `Using PIP ` method, you have to activate the environment that was created for DIPLOMAT in
186+ a previous step.
187+
188+ Activating with Mamba
189+ ~~~~~~~~~~~~~~~~~~~~~
190+ If you used the mamba installation
191+ process, you'll run
192+ ``mamba activate DIPLOMAT-DEEPLABCUT `` or
193+ ``mamba activate DIPLOMAT-SLEAP ``.
194+
195+ Activating with venv
196+ ~~~~~~~~~~~~~~~~~~
197+ If you followed the virtual environment-based methods (DLC troubleshooting or developer
198+ install) you'll run ``venv/scripts/Activate `` on Windows or ``source venv/bin/activate ``
199+ on Mac/Linux (replacing `venv ` with whatever you named the virtual environment.)
200+
201+ Activating with PIP
202+ ~~~~~~~~~~~~~~~~~~~
203+ If you followed the PIP-only method and installed DIPLOMAT to your default environment,
204+ no action is necessary.
205+
206+ Verify
207+ ^^^^^^
208+ In the directory containing the sample video and model, you can run track to verify that
209+ all of DIPLOMAT's functionality were installed properly.
210+
211+ Verify tracking without GUI
212+ ~~~~~~~~~~~~~~~~~~~~
213+ For DeepLabCut, run
214+ ``diplomat track -c test_dlc_5 -v N5PZS.avi ``.
215+
216+ For SLEAP, run
217+ ``diplomat track -c test_sleap_5 -v N5PZS.avi ``.
218+
219+ If the tracking completes successfully, a new file ending with extension either `.h5 ` or
220+ `.slp ` will now be present.
221+
222+ Verify tracking with GUI
223+ ~~~~~~~~~~~~~~~~~
224+ For DeepLabCut, run
225+ ``diplomat track_and_interact -c test_dlc_5 -v N5PZS.avi ``.
226+
227+ For SLEAP, run
228+ ``diplomat track_and_interact -c test_sleap_5 -v N5PZS.avi ``.
229+
230+ After tracking completes, the manual annotation window will be opened and you should be
231+ able to make changes to the automated results.
0 commit comments