Skip to content

deeplabcut.create_labeled_video_3d() ValueError: cannot reshape array of size 2826 into shape (161,newaxis,3) #2205

@wangziying1004

Description

@wangziying1004

Is there an existing issue for this?

  • I have searched the existing issues

Bug description

Hello, I'm wangziying.
I have a problem with deeplabcut.create_labeled_video_3d() function.
I tried:

deeplabcut.create_labeled_video_3d(config_path, ['/content/drive/MyDrive/testing3d-DLC-2023-04-14-3d/videofoldertest'], start=0, end=157,videotype = '.mp4')
but I got this:
Analyzing all the videos in the directory
[['/content/drive/MyDrive/testing3d-DLC-2023-04-14-3d/videofoldertest/handtest1_DLC_3D.h5', '/content/drive/MyDrive/testing3d-DLC-2023-04-14-3d/videofoldertest/handtest1-camera-1.mp4', '/content/drive/MyDrive/testing3d-DLC-2023-04-14-3d/videofoldertest/handtest1-camera-2.mp4']]
Creating 3D video from handtest1-camera-1.mp4 and handtest1-camera-2.mp4 using handtest1_DLC_3D.h5
Looking for filtered predictions...
Found the following filtered data:  /content/drive/MyDrive/testing3d-DLC-2023-04-14-3d/videofoldertest/*handtest1-camera-1DLC_resnet50_handtest1Apr14shuffle1_8000*filtered.h5 /content/drive/MyDrive/testing3d-DLC-2023-04-14-3d/videofoldertest/*handtest1-camera-2DLC_resnet50_handtest1.1Apr14shuffle1_10500*filtered.h5
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
[<ipython-input-8-9a76379fb8de>](https://localhost:8080/#) in <cell line: 1>()
----> 1 deeplabcut.create_labeled_video_3d(config_path, ['/content/drive/MyDrive/testing3d-DLC-2023-04-14-3d/videofoldertest'], start=0, end=157,videotype = '.mp4')

[/usr/local/lib/python3.9/dist-packages/deeplabcut/pose_estimation_3d/plotting3D.py](https://localhost:8080/#) in create_labeled_video_3d(config, path, videofolder, start, end, trailpoints, videotype, view, xlim, ylim, zlim, draw_skeleton, color_by, figsize, fps, dpi)
    273             visible1 = xy1[..., 2] >= pcutoff
    274             xy1[~visible1] = np.nan
--> 275             xy2 = df_cam2.loc[:, mask2d].to_numpy().reshape((len(df_cam1), -1, 3))
    276             visible2 = xy2[..., 2] >= pcutoff
    277             xy2[~visible2] = np.nan

ValueError: cannot reshape array of size 2826 into shape (161,newaxis,3)

I tried searching for related errors in Google and found that it may have been caused by different sizes of the video. I also changed the size of the video, but the same error still occurred.
Could you help me solve this probelm?

Operating System

windows

DeepLabCut version

dlc version 2.2.3

DeepLabCut mode

single animal

Device type

gpu

Steps To Reproduce

No response

Relevant log output

No response

Anything else?

No response

Code of Conduct

Metadata

Metadata

Assignees

Labels

3Dquestions/code issues regarding 3D DLC

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions