op_create_csv: Create CSV from JSON files

View source: R/op_create_csv.R

op_create_csvR Documentation

Create CSV from JSON files

Description

This function reads JSON files from the specified directory, processes the pose keypoints, and saves the results into CSV files.

Usage

op_create_csv(
  input_path,
  output_path = input_path,
  model = "all",
  include_filename = FALSE,
  include_labels = FALSE,
  frame_width = 1920,
  export_type = "dyad"
)

Arguments

input_path

Path to the directory containing JSON files.

output_path

Path to the directory where CSV files will be saved. Defaults to the input path.

model

The model to use: "all", "body", "hands", or "face". Defaults to "all".

include_filename

Boolean indicating whether to include the base filename in column names. Defaults to FALSE.

include_labels

Boolean indicating whether to rename columns based on region labels. Defaults to FALSE.

frame_width

Width of the frame. Defaults to 1920.

export_type

Type of export: "individual" to export separate CSV files for each person, "dyad" to export both persons' data into a single CSV file. Defaults to "individual".

Value

No return value. This function is called for its side effects, which include writing CSV files to the specified output directory.

Examples


# Path to example JSON files included with the package
input_path <- system.file("extdata/json_files", package = "duet")

# Temporary output directory
output_path <- tempfile("output_csv")
dir.create(output_path)

# Run the function using the provided data
op_create_csv(
  input_path = input_path,
  output_path = output_path,
  model = "body",
  include_filename = TRUE,
  include_labels = TRUE,
  frame_width = 1920,
  export_type = "dyad"
)


duet documentation built on April 3, 2025, 5:52 p.m.

Related to op_create_csv in duet...