Visitar URL original
Switch 3D config reads to plain read by C-Achard · Pull Request #3587 · DeepLabCut/DeepLabCut · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix additional 3D config validation sites
  • Loading branch information
C-Achard committed Nov 13, 2026
commit a4e06439978ca9851d52c7c505169a5c7bbdd889
2 changes: 1 addition & 1 deletion deeplabcut/generate_training_dataset/frame_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ def extract_frames(
project_path = Path(config).parents[0]
labels_path = project_path / "labeled-data"
try:
cfg_3d = auxiliaryfunctions.read_config(config3d)
cfg_3d = auxiliaryfunctions.read_plainconfig(config3d)
except Exception as e:
raise Exception(
"You must create a 3D project and edit the 3D config file before extracting matched frames. \n"
Expand Down
2 changes: 1 addition & 1 deletion examples/testscript_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
path_config_file = deeplabcut.create_new_project_3d(task, scorer, num_cameras)

try:
cfg = deeplabcut.auxiliaryfunctions.read_config(path_config_file)
cfg = deeplabcut.auxiliaryfunctions.read_plainconfig(path_config_file)
cfg["config_file_camera-1"] = config
cfg["shuffle_camera-1"] = 1

Expand Down
9 changes: 9 additions & 0 deletions tests/generate_training_dataset/test_frame_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,12 @@ def test_filter_config_videos_matches_string_to_path(self):
def test_filter_config_videos_raises_for_empty_selection(self):
with pytest.raises(ValueError, match="None of the selected videos matched"):
_filter_config_videos(["video-a.mp4"], [])


def test_extract_frames_match_reads_3d_config(valid_project, tmp_path):
"""Regression test for #3585: mode="match" must read the 3D config without 2D validation."""
from deeplabcut.create_project.new_3d import create_new_project_3d

config_3d = create_new_project_3d("trial", "tester", num_cameras=2, working_directory=str(tmp_path / "3d"))

extract_frames(str(valid_project / "config.yaml"), mode="match", config3d=config_3d, userfeedback=False)
Loading