Save SDPose Keypoints as JSON:
The SDPoseSaveJson node is designed to save pose keypoints into a JSON file, providing a structured way to store and manage pose data. This node is particularly useful for AI artists who work with pose data and need a reliable method to save their work for future use or analysis. The node offers flexibility in file management by allowing users to choose between overwriting existing files or automatically incrementing file names to prevent overwriting. Additionally, it supports the inclusion of frames per second (fps) information in the JSON file, which can be crucial for applications involving animations or time-based data. By using this node, you can ensure that your pose data is saved in a consistent and organized manner, facilitating easy retrieval and use in subsequent projects.
Save SDPose Keypoints as JSON Input Parameters:
pose_kps
This parameter represents the pose keypoints that you want to save. It is a structured data input that contains the keypoints information, which is essential for the node to function correctly. The pose keypoints are typically extracted from images or video frames and are used to represent the positions of various body parts.
filename_prefix
The filename_prefix parameter allows you to specify a prefix for the output JSON file's name. This helps in organizing and identifying files, especially when dealing with multiple outputs. The default value is "PoseKeypoint", but you can customize it to suit your project's naming conventions.
fps
The fps parameter stands for frames per second and is optional. It allows you to include fps information in the JSON file's header if set to a value greater than 0. This is particularly useful for animation projects where timing is crucial. The default value is 0, which means the fps will not be included, and the data will be saved as a raw array for backward compatibility. The parameter accepts values between 0 and 120.
overwrite
This boolean parameter determines whether the node should overwrite existing files or create new ones with incremented names. If set to True, the node will overwrite the previous file, maintaining backward compatibility. If set to False, it will automatically increment the file name to avoid overwriting. The default value is True.
Save SDPose Keypoints as JSON Output Parameters:
The SDPoseSaveJson node does not produce any direct output parameters. Instead, its primary function is to save the input pose keypoints to a JSON file, which can then be used externally.
Save SDPose Keypoints as JSON Usage Tips:
- To avoid accidentally overwriting important files, set the
overwriteparameter to False, which will automatically increment the file name. - If you are working with animations, make sure to set the
fpsparameter to a value greater than 0 to include timing information in your JSON file.
Save SDPose Keypoints as JSON Common Errors and Solutions:
FileNotFoundError: JSON file not found
- Explanation: This error occurs when the specified file path does not exist or is incorrect.
- Solution: Double-check the file path and ensure that it is correct. Make sure the directory exists and that you have the necessary permissions to write to it.
ValueError: JSON wrapper format: 'frames' must be a list
- Explanation: This error indicates that the JSON data structure is not formatted correctly, specifically that the 'frames' key is not associated with a list.
- Solution: Ensure that the input data is correctly structured, with 'frames' being a list of frame data. Verify the data format before attempting to save it.
