-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Number of frames different for DLC2 and DLC #51
Comments
Hi Ben, can you be more specific about what function you are using, and I assume you mean H5, correct? We don't recommend using the CSV files |
Hello, Thank you for your quick response. Yes, sorry I meant the .h5 file. I have done all of the training, plotted the coordinates and created the videos. I then take the saved .h5 file for each animal and using DLC2Kinematics I create the joint dictionary and then compute the joint angles. This works well. However, when I go to combine the DLC data with the Angle data from DLC2Kinematics, there have been instances where the number of frames analysed is not the same. For example, one particular animal the video has 495 frames. The angle data only has 470 data points. However, the angle data is continuous, and isn't missing when there are instances of lower likelihood. I was therefore wondering if there was an explanation for this? The compute angles code is: FileType = ".h5" df, bodyparts, scorer = dlc2kinematics.load_data(f'/content/drive/My Drive/Exp2-2DKinematics3-Ben-2024-09-09/videos/Rat{rat}-35-1-IPDLC_resnet50_Exp2-2DKinematics3Sep9shuffle1_600000.h5') print(bodyparts) # Display the list of body parts df[1:] joints_dict={} joints_dict['Hip'] = ['IliacCrest', 'Hip','Knee'] print(joints_dict) Compute joint angles:joint_angles = dlc2kinematics.compute_joint_angles(df, joints_dict, dropnan=True, smooth=True, save=False) #do I want smoothing? Plot the joint angles:dlc2kinematics.plot_joint_angles(joint_angles) Save the joint angles to a CSV file:joint_angles.to_csv(f'/content/drive/My Drive/Exp2-2DKinematics3-Ben-2024-09-09/videos/Rat{rat}JointAngles.csv', index=False) Many thanks, Ben |
Hi, I think I’ve figured it out. The missing values were due to To retain 'null' values (e.g., when angles can't be computed due to low likelihoods from blocked joint views), it's essential to set Keeping it as |
Hello,
I have my DLC coordinates saved in a .csv file. I have then ran the compute joint angles function on DLC2Kinematics.
When I have gone to add them to the same worksheet I have noticed a few instances where the number of frames analysed in the DLC file is different for the same file analysed by DLC2Kinematics, only by a small number of frames. The DLC2 will have less than the DLC.
I have checked that I have loaded the correct csv file in. I don't seem to have any missing values either.
I am therefore wondering, if DLC2kinematics is only analysing the coordinates when the likelihood is over a certain threshold? Or whether there would likely be any other explantaion?
Thank you,
Ben
The text was updated successfully, but these errors were encountered: