-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpreprocess.py
More file actions
30 lines (24 loc) · 806 Bytes
/
preprocess.py
File metadata and controls
30 lines (24 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import tyro
from pape.configs import Dataset
from pape.preprocessing.dvs_gesture import DVSGesturePreprocessor
from pape.preprocessing.gen1 import Gen1Preprocessor
def main(
dataset: Dataset,
/,
limit: int | None = None,
chunk_duration_ms: int = 250,
train: bool = True,
val: bool = True,
test: bool = True,
):
match dataset:
case Dataset.dvsgesture:
preprocessor = DVSGesturePreprocessor(limit=limit, test=test, train=train)
case Dataset.gen1:
preprocessor = Gen1Preprocessor(
chunk_duration_ms=chunk_duration_ms, limit=limit, test=test, train=train, val=val
)
case _:
raise ValueError(f"Missing preprocessor for dataset: {dataset}")
preprocessor.preprocess()
tyro.cli(main)