|
|
|
|
|
|
|
|
|
|
|
|
|
import json |
|
from dataclasses import dataclass, fields |
|
from enum import Enum |
|
|
|
""" |
|
Each sequence folder follows the following structure. |
|
Files might be missing if not downloaded. |
|
βββ LICENSE |
|
βββ metadata.json |
|
βββ body |
|
βΒ Β βββ xdata_blueman.glb |
|
βΒ Β βββ xdata.healthcheck |
|
βΒ Β βββ xdata.mvnx |
|
βΒ Β βββ xdata.npz |
|
βββ narration |
|
βΒ Β βββ activity_summarization.csv |
|
βΒ Β βββ atomic_action.csv |
|
βΒ Β βββ motion_narration.csv |
|
βββ recording_head / recording_observer |
|
βΒ Β βββ data |
|
βΒ Β β βββ data.vrs |
|
βΒ Β β βββ et.vrs |
|
βΒ Β βΒ Β βββ motion.vrs |
|
βΒ Β βββ mps |
|
βΒ Β βββ eye_gaze |
|
βΒ Β βΒ Β βββ general_eye_gaze.csv |
|
βΒ Β βΒ Β βββ personalized_eye_gaze.csv |
|
βΒ Β βββ slam |
|
βΒ Β βββ closed_loop_trajectory.csv |
|
βΒ Β βββ online_calibration.jsonl |
|
βΒ Β βββ open_loop_trajectory.csv |
|
βΒ Β βββ semidense_observations.csv.gz |
|
βΒ Β βββ semidense_points.csv.gz |
|
βΒ Β βββ summary.json |
|
βββ recording_rwrist / recording_lwrist |
|
βββ data |
|
Β Β β βββ data.vrs |
|
βΒ Β βββ motion.vrs |
|
βββ mps |
|
βββ slam |
|
βββ closed_loop_trajectory.csv |
|
βββ online_calibration.jsonl |
|
βββ open_loop_trajectory.csv |
|
βββ semidense_observations.csv.gz |
|
βββ semidense_points.csv.gz |
|
βββ summary.json |
|
|
|
""" |
|
|
|
NYMERIA_VERSION: str = "v0.0" |
|
|
|
|
|
@dataclass(frozen=True) |
|
class MetaFiles: |
|
license: str = "LICENSE" |
|
metadata_json: str = "metadata.json" |
|
|
|
|
|
@dataclass(frozen=True) |
|
class Subpaths(MetaFiles): |
|
body: str = "body" |
|
text: str = "narration" |
|
|
|
recording_head: str = "recording_head" |
|
recording_lwrist: str = "recording_lwrist" |
|
recording_rwrist: str = "recording_rwrist" |
|
recording_observer: str = "recording_observer" |
|
|
|
vrs: str = "data" |
|
mps: str = "mps" |
|
mps_slam: str = "mps/slam" |
|
mps_gaze: str = "mps/eye_gaze" |
|
|
|
|
|
@dataclass(frozen=True) |
|
class BodyFiles: |
|
xsens_processed: str = f"{Subpaths.body}/xdata.npz" |
|
xsens_raw: str = f"{Subpaths.body}/xdata.mvnx" |
|
momentum_model: str = f"{Subpaths.body}/xdata_blueman.glb" |
|
|
|
|
|
@dataclass(frozen=True) |
|
class TextFiles: |
|
motion_narration: str = f"{Subpaths.text}/motion_narration.csv" |
|
atomic_action: str = f"{Subpaths.text}/atomic_action.csv" |
|
activity_summarization: str = f"{Subpaths.text}/activity_summarization.csv" |
|
|
|
|
|
@dataclass(frozen=True) |
|
class VrsFiles: |
|
data: str = f"{Subpaths.vrs}/data.vrs" |
|
motion: str = f"{Subpaths.vrs}/motion.vrs" |
|
et: str = f"{Subpaths.vrs}/et.vrs" |
|
|
|
|
|
@dataclass(frozen=True) |
|
class SlamFiles: |
|
closed_loop_trajectory: str = f"{Subpaths.mps_slam}/closed_loop_trajectory.csv" |
|
online_calibration: str = f"{Subpaths.mps_slam}/online_calibration.jsonl" |
|
open_loop_trajectory: str = f"{Subpaths.mps_slam}/open_loop_trajectory.csv" |
|
semidense_points: str = f"{Subpaths.mps_slam}/semidense_points.csv.gz" |
|
semidense_observations: str = f"{Subpaths.mps_slam}/semidense_observations.csv.gz" |
|
location_summary: str = f"{Subpaths.mps_slam}/summary.json" |
|
|
|
|
|
@dataclass(frozen=True) |
|
class GazeFiles: |
|
general_gaze: str = f"{Subpaths.mps_gaze}/general_eye_gaze.csv" |
|
personalized_gaze: str = f"{Subpaths.mps_gaze}/personalized_eye_gaze.csv" |
|
|
|
|
|
class DataGroups(Enum): |
|
""" |
|
\brief Each variable defines one atomic downloadable element |
|
""" |
|
|
|
LICENSE = Subpaths.license |
|
metadata_json = Subpaths.metadata_json |
|
|
|
body = Subpaths.body |
|
|
|
recording_head = Subpaths.recording_head |
|
recording_head_data_data_vrs = f"{Subpaths.recording_head}/{VrsFiles.data}" |
|
recording_lwrist = Subpaths.recording_lwrist |
|
recording_rwrist = Subpaths.recording_rwrist |
|
recording_observer = Subpaths.recording_observer |
|
recording_observer_data_data_vrs = f"{Subpaths.recording_observer}/{VrsFiles.data}" |
|
|
|
narration_motion_narration_csv = TextFiles.motion_narration |
|
narration_atomic_action_csv = TextFiles.atomic_action |
|
narration_activity_summarization_csv = TextFiles.activity_summarization |
|
|
|
semidense_observations = "semidense_observations" |
|
|
|
|
|
def get_group_definitions() -> dict[str, list]: |
|
""" |
|
\brief Definition of DataGroups |
|
File paths are relative with respect to each sequence folder. |
|
Some sequences might missing certain files/data groups |
|
due to errors occured from data collection or processing. |
|
There is one url per data group per sequence. |
|
Data groups with multiple files are packed into zip files. |
|
""" |
|
AriaFiles = ( |
|
[f.default for f in fields(VrsFiles) if "data" not in f.name] |
|
+ [f.default for f in fields(SlamFiles) if "observations" not in f.name] |
|
+ [f.default for f in fields(GazeFiles)] |
|
) |
|
miniAriaFiles = [f.default for f in fields(VrsFiles) if "et" not in f.name] + [ |
|
f.default for f in fields(SlamFiles) if "observerations" not in f.name |
|
] |
|
|
|
g_defs = {x.name: [x.value] for x in DataGroups} |
|
g_defs[DataGroups.body.name] = [x.default for x in fields(BodyFiles)] |
|
|
|
for x in [DataGroups.recording_head, DataGroups.recording_observer]: |
|
g_defs[x.name] = [f"{x.name}/{f}" for f in AriaFiles] |
|
|
|
for x in [DataGroups.recording_rwrist, DataGroups.recording_lwrist]: |
|
g_defs[x.name] = [f"{x.name}/{f}" for f in miniAriaFiles] |
|
|
|
g_defs[DataGroups.semidense_observations.name] = [] |
|
for x in fields(Subpaths): |
|
if "recording" in x.name: |
|
g_defs[DataGroups.semidense_observations.name].append( |
|
f"{x.default}/{SlamFiles.semidense_observations}" |
|
) |
|
|
|
print("=== group definitions (group_name: [group_files]) ===") |
|
print(json.dumps(g_defs, indent=2)) |
|
|
|
return g_defs |
|
|
|
|
|
|
|
|