MCPcopy Index your code
hub / github.com/DeepLabCut/DeepLabCut / label_frames

Function label_frames

deeplabcut/gui/tabs/label_frames.py:25–95  ·  view source on GitHub ↗

Launches the napari-deeplabcut labelling GUI. For more information on labelling data with napari-deeplabcut, see our docs: https://github.com/DeepLabCut/napari-deeplabcut?tab=readme-ov-file#usage If no parameters are given, the napari-deeplabcut labelling GUI is simply open, an

(config_path: str | Path | None = None, image_folder: str | None = None)

Source from the content-addressed store, hash-verified

23
24
25def label_frames(config_path: str | Path | None = None, image_folder: str | None = None):
26 """Launches the napari-deeplabcut labelling GUI.
27
28 For more information on labelling data with napari-deeplabcut, see our docs:
29 https://github.com/DeepLabCut/napari-deeplabcut?tab=readme-ov-file#usage
30
31 If no parameters are given, the napari-deeplabcut labelling GUI is simply open,
32 and the folder containing the images to label can be dropped into the GUI.
33
34 If the `config_path` and the `image_folder` are given as arguments, the given
35 `image_folder` for the project is opened in the napari-deeplabcut GUI to be labeled.
36 If only the `config_path` is given, the first image folder is opened.
37
38 Parameters
39 ----------
40 config_path: str, Path, None
41 Full path of the project config.yaml file.
42
43 image_folder: str, None
44 Name of the image folder to open for labelling.
45
46 Examples
47 --------
48 Opening the napari-deeplabcut annotation GUI without opening a specific folder of
49 images to label. You then need to drag-and-drop your image folder into the GUI.
50 See the napari-deeplabcut docs linked above for more information about labelling in
51 napari-deeplabcut.
52 >>> import deeplabcut
53 >>> deeplabcut.label_frames()
54
55 Opening the images extracted from the "2025-01-01-experiment7" video in
56 napari-deeplabcut on Windows. The project's folder structure should look as follows:
57 reaching-task/ # project root directory
58 ├── config.yaml # project configuration file
59 └── labeled-data/ # folder containing all extracted image folders
60 ├── ...
61 ├── 2025-01-01-experiment7 # folder containing the images to label
62 └── ...
63
64 >>> deeplabcut.label_frames(
65 >>> "C:\\myproject\\reaching-task\\config.yaml",
66 >>> "2025-01-01-experiment7",
67 >>> )
68
69 Opening the images extracted from the first video listed in the project
70 configuration in napari-deeplabcut on a Unix system.
71 >>> deeplabcut.label_frames("/users/john/project/config.yaml")
72 """
73 files = None
74 if config_path is None:
75 if image_folder is not None:
76 raise ValueError(
77 f"If the ``config_path`` is None, the ``image_folder`` must be None "
78 f"too. Found {image_folder}. To label the images in {image_folder}, "
79 f"give the project configuration file as `config_path`."
80 )
81 else:
82 data_dir = Path(config_path).parent / "labeled-data"

Callers

nothing calls this directly

Calls 1

launch_napariFunction · 0.90

Tested by

no test coverage detected