Migrating to the App

From the old app

These instructions convert a singleview project directory from the old app to make it compatible with the new app.

1. Copy the old app’s project directory out into a new folder to work on:

# Copies project directory from old path to new location.
cp -r ~/Pose-app/data/PROJECT_NAME  ~/LPProjects/PROJECT_NAME

2. Fix data directory structure

The old app directory structure is as follows:

PROJ_DIR/
β”œβ”€β”€ labeled-data/
|   └── session0/
|       └── selected_frames.csv
β”œβ”€β”€ videos/
β”œβ”€β”€ videos_infer/
β”œβ”€β”€ CollectedData.csv
β”œβ”€β”€ label_studio_config.xml
β”œβ”€β”€ label_studio_metadata.yaml
β”œβ”€β”€ label_studio_tasks.pkl
β”œβ”€β”€ model_config_<PROJ_NAME>.yaml
└── models/
    └── YYYY-MM-DD/
        └── HH-MM-SS_model_name/
            └── video_preds_infer/

The task is to make the directory structure conform to the specification in Singleview Data Directory Structure.

The following changes are required:

  1. Create a project.yaml file in the project data directory per the docs.

  2. Add the project to ~/.lightning-pose/projects.toml, following the guide at Add an existing project directory.

  3. Copy all videos from the videos_infer to videos directory. (Required to see these in the viewer.)

  4. Rename the video prediction directory in the model directories from video_preds_infer to video_preds.

The following are recommended, but not strictly required:

  1. Remove label_studio files. If you had unlabeled frames in the labeling queue, these will be lost and need to be re-extracted. Alternatively, manually migrate these using the to unlabeled sidecar format.

  2. Remove model_config_<PROJ_NAME>.yaml file, as its no longer used.

  3. Use ffmpeg to re-encode videos such that every frame is an Intra frame. This is required in order for the app viewer to be 100% frame-accurate, but not strictly required otherwise.

That’s it. Next time you run the app and you should see your new singleview project.

From the CLI

The task is to make the directory structure conform to the specification in Singleview Data Directory Structure or Multiview Data Directory Structure, depending on your project type.

The app should work with just the following:

  1. Create a project.yaml file in the project data directory per the docs.

  2. Add the project to ~/.lightning-pose/projects.toml, following the guide at Add an existing project directory.

Simplest example

If your current directory structure is:

~/data/
~/lightning-pose/outputs/

Then you can add a projects.yaml file at ~/data/project.yaml, and add the following to ~/.lightning-pose/projects.toml:

[example-project]
data_dir = "/home/username/data"
model_dir = "/home/username/lightning-pose/outputs"

You should consider:

  • Moving models into data directory so it’s one directory, rather than having models and data be separate.

  • If you do this, you can remove the model_dir attribute from the projects.toml file.

Verify that the following against the Directory Structure docs:

  • Label files are stored as expected

  • Extracted frames are stored as specified

  • Multiview: verify calibration file naming