Preprocess¶
1. Preprocess 문¶
사용자는 "Preprocess" 구문을 사용하여 ThanoSQL의 "Preprocess" 함수를 통해 데이터를 전처리합니다.
2. Preprocess 함수¶
2-1. video_to_df¶
"video_to_df"는 비디오를 일정한 간격으로 분할하여 파일로 저장하고 데이터 테이블을 만드는 기능입니다.
video_to_df 구문
query_statement:
    query_expr
FUNCTION preprocess.video_to_df
OPTIONS (
    expression [ , ...]
    )
{ AS (query_expr) | FROM {file_path_expression} }
OPTIONS 절
OPTIONS (
    [method={'split'}],
    [interval=VALUE],
    (result_col=expression),
    (result_dir=expression)
    )
"OPTIONS" 절에서 매개변수의 값을 기본값으로부터 변경할 수 있습니다. 각 매개변수의 의미는 아래와 같습니다.
- "method": 영상 전처리 방식을 설정합니다. 현재는 'split'만 지원합니다. (str)
 - "interval": 간격을 초 단위로 설정합니다. (int, optional, default: 1)
 - "result_col": 전처리 후 분할 영상 경로를 담을 컬럼 이름을 설정합니다. (str)
 - "result_dir": 전처리 후 분할 영상이 저장될 폴더 이름을 설정합니다. (str)
 
video_to_df 예시
%%thanosql
FUNCTION preprocess.video_to_df
OPTIONS (
   method='split',
   interval=1,
   result_col='video_split_path', 
   result_dir='video_split_folder'
    )
FROM 'thanosql-dataset/kinetics700_data/video/1ejgHKw8E3Y.mp4'
  
    
      Last update:
      2022-12-28