create_csv | R Documentation |
Creates one or severeal CSV files (*.csv) from the JSON output files (*.json) generated by OpenPose.
By default, OpenPose generates one JSON file per tracked frame in a video file. These files contain positional (x,y) information as well as a confidence score (c) for every point tracked by the model at this particular frame.
Because CSV files and tabular data are sometimes more convenient to work with, this function reads the JSON files for every frame and combines them into a single CSV file for every model. At a minimum this will be data from the BODY25 model (filename_body25.csv), but may be supplemented by data from a face and hand model.
create_csv(input_path, filename, output_path, model)
input_path |
Path to folder containting JSON (*.json) files generated by OpenPose. |
filename |
Name of the tracked video file. By default, this should be the prefix of all JSON files generated by OpenPose (e.g., filename_framenumber_keypoints.json). |
output_path |
Optional. Path to folder for output CSV files (*.csv) files. Defaults to input_path. |
model |
Optional. By default, will generate CSV files (*.csv) for all models for which data is available in the JSON files. Supplying either body25, hands, or face will limit generation of output CSV files to the specified model. |
# Generate CSV for "myvideo" with JSON files located in "~/myvideo" create_csv("~/myvideo", "myvideo") # Generate CSV for "myvideo" with JSON files located in "~/myvideo" # Write output to subfolder /output and only use data from hands model create_csv("~/myvideo", "myvideo", "~/myvideo/output", model = "hands")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.