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

Function create_new_project

deeplabcut/create_project/new.py:26–320  ·  view source on GitHub ↗

r"""Create the necessary folders and files for a new project. Creating a new project involves creating the project directory, sub-directories and a basic configuration file. The configuration file is loaded with the default values. Change its parameters to your projects need. Param

(
    project: str,
    experimenter: str,
    videos: list[str],
    working_directory: str | None = None,
    copy_videos: bool = False,
    video_extensions: str | Sequence[str] | None = None,
    multianimal: bool = False,
    individuals: list[str] | None = None,
)

Source from the content-addressed store, hash-verified

24
25@renamed_parameter(old="videotype", new="video_extensions", since="3.0.0")
26def create_new_project(
27 project: str,
28 experimenter: str,
29 videos: list[str],
30 working_directory: str | None = None,
31 copy_videos: bool = False,
32 video_extensions: str | Sequence[str] | None = None,
33 multianimal: bool = False,
34 individuals: list[str] | None = None,
35):
36 r"""Create the necessary folders and files for a new project.
37
38 Creating a new project involves creating the project directory, sub-directories and
39 a basic configuration file. The configuration file is loaded with the default
40 values. Change its parameters to your projects need.
41
42 Parameters
43 ----------
44 project : string
45 The name of the project.
46
47 experimenter : string
48 The name of the experimenter.
49
50 videos : list[str]
51 A list of strings representing the full paths of the videos or video-directories
52 to include in the project.
53
54 video_extensions (str | Sequence[str] | None, default=None):
55 Controls how ``videos`` are filtered, based on file extension.
56 File paths and directory contents are treated differently:
57 - ``None`` (default): file paths are accepted as-is; directories are
58 scanned for files with a recognized video extension.
59 - ``str`` or ``Sequence[str]`` (e.g. ``"mp4"`` or ``["mp4", "avi"]``):
60 both file paths and directory contents are filtered by the given
61 extension(s).
62
63 working_directory : string, optional
64 The directory where the project will be created. The default is the
65 ``current working directory``.
66
67 copy_videos : bool, optional, Default: False.
68 If True, the videos are copied to the ``videos`` directory. If False, symlinks
69 of the videos will be created in the ``project/videos`` directory; in the event
70 of a failure to create symbolic links, videos will be moved instead.
71
72 multianimal: bool, optional. Default: False.
73 For creating a multi-animal project (introduced in DLC 2.2)
74
75 individuals: list[str]|None = None,
76 Relevant only if multianimal is True.
77 list of individuals to be used in the project configuration.
78 If None - defaults to ['individual1', 'individual2', 'individual3']
79
80 Returns
81 -------
82 str
83 Path to the new project configuration file.

Callers 1

finalize_projectMethod · 0.90

Calls 8

get_bboxMethod · 0.95
collect_video_pathsFunction · 0.90
VideoReaderClass · 0.90
itemsMethod · 0.80
removeMethod · 0.80
formatMethod · 0.80
getMethod · 0.45
write_configMethod · 0.45

Tested by

no test coverage detected