🧵 How to automatically fit Splines to your recordings - articulateinstruments/AAA-DeepLabCut-Resources GitHub Wiki

You can only automatically fit 2D splines with machine learning if you installed this optional feature when you installed AAA. If you don’t have it, you can add it to your existing installation of AAA by running the AAA installer again, and selecting only the machine learning component during installation.

Contents of this page:


How to fit splines to one recording

  1. Load the recording you want to fit a spline to.
Ultrasonic and video data streams are stored and processed separately and when splines are generated they are associated with either video or ultrasonic. This prevents lip video splines appearing on an ultrasonic tongue image and vice versa.
  1. Open the Edit Splines dialog. To do this, Right-Click right-click on the ultrasonic display in any task window or the video display.

image

image

  1. Use the tabs at the top to go to the Fit Spline tab.
  2. Choose DeepLabCut as the Autofit Method.
  3. Click Go to Batch DeepLabCut Settings.

image

6. [Optional] Click on Choose DeepLabCut Model / Settings and select which DeepLabCut model you would like to use to add splines to your data.
(Click here for an image showing this)

  1. Use the list on the right to select which splines you want to be added to your data.
  2. Use the controls in the bottom-left to inform AAA which direction the tongue-tip is facing in the ultrasound image.
  3. To initiate the automatic spline fitting process, click Process.
How long DeepLabCut takes will depend on what GPU and CPU your computer has. If you have an ordinary office PC then automatically fitting splines might take as long as 20 times real time (i.e. 30 minutes of recorded data might take 10 hours to process). For a fast modern computer it’s approximately 8 times real-time (i.e. 4 hours for 30 minutes of data). If your computer contains a NVIDIA GPU then it’s approximately 2x real-time (i.e. 1 hour for 30 minutes of data).

Please note that DeepLabCut Live, which is what AAA uses, is not compatible with Nvidia cards of the 5000 series or newer (such as the RTX 5060). If you have a GPU like this you can still use DeepLabCut in AAA, it will just be slower because it will use your CPU instead.


How to fit splines to many recordings at once

Batch Splining lets you choose what spline(s) to add at the beginning, then it will fit splines to many recordings at once according to those settings.

  1. Load one of the recordings that you want to fit a spline to. It doesn't matter which one.
  2. Open the Edit Splines dialog. To do this, Right-Click right-click on the ultrasonic display in any task window or the video display.

image

image

  1. Use the tabs at the top to go to the Fit Spline tab.
  2. Choose DeepLabCut as the Autofit Method.
  3. At the top of the dialog click the Batch tab and then click the Choose Recordings sub-tab.

image

  1. Click the Recordings or Annotations button to choose whether you want to fit splines to entire recordings or only to annotated regions of recordings.
  2. Click the Change Filter button and select which recordings or annotations you want to fit splines to.
    When you save the filter, you will see a list of your selected recordings or annotations. Please check that it looks correct.
  3. Click on the Process Batch sub-tab.

image

Check that the specification at the top confirms:

  • You are using the DeepLabCut method.
  • You are using the Tongue model if ultrasonic or Lip model if lip video.
  • It is set to spline every ultrasound frame.
6. [Optional] Click on Choose DeepLabCut Model / Settings and select which DeepLabCut model you would like to use to add splines to your data.
(Click here for an image showing this)

  1. Use the list on the right to select which splines you want to be added to your data.
  2. Use the controls in the bottom-left to inform AAA which direction the tongue-tip is facing in the ultrasound image.
If you check Monitor Progress then the ultrasound display will show the splines being fit in real time. This slows down the spline fitting process, but it is useful to check that it is behaving as you expect.
  1. To initiate the automatic spline fitting process, click Process.
⚠️ **GitHub.com Fallback** ⚠️