Datasets:
jingyan wang commited on
Commit ·
9a08cf2
1
Parent(s): a82f905
update new dataset
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- builder.py +55 -111
- depthdata/{2025_06_16_21_27-mastlab-yao-0001.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0001-1.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0002.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0001-2.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0003.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0002-1.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0004.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0002-2.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0005.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0003-1.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0006.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0003-2.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0007.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0004-1.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0008.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0004-2.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0009.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0005-1.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0010.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0005-2.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0011.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0006-1.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0012.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0006-2.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0013.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0007-1.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0014.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0007-2.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0015.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0008-1.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0016.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0008-2.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0017.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0009-1.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0018.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0009-2.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0019.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0010-1.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0020.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0010-2.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0021.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0011-1.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0022.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0011-2.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0023.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0012-1.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0024.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0012-2.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0025.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0013-1.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0026.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0013-2.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0027.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0014-1.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0028.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0014-2.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0029.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0015-1.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0030.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0015-2.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0031.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0016-1.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0032.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0016-2.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0033.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0017-1.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0034.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0017-2.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0035.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0018-1.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0036.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0018-2.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0037.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0019-1.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0038.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0019-2.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0039.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0020-1.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0040.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0020-2.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0041.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0021-1.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0042.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0021-2.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0043.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0022-1.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0044.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0022-2.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0045.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0023-1.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0046.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0023-2.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0047.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0024-1.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0048.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0024-2.npy} +0 -0
- depthdata/{2025_06_16_21_27-mastlab-yao-0049.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0025-1.npy} +0 -0
builder.py
CHANGED
|
@@ -3,83 +3,8 @@
|
|
| 3 |
# depth: 2025_06_16_21_27-mastlab-yao-0001
|
| 4 |
#
|
| 5 |
import os
|
| 6 |
-
from pandas.io.xml import file_exists
|
| 7 |
import polars as pl
|
| 8 |
-
|
| 9 |
-
from polars.testing import assert_series_equal
|
| 10 |
-
from datasets import (
|
| 11 |
-
DatasetBuilder,
|
| 12 |
-
BuilderConfig,
|
| 13 |
-
load_dataset_builder,
|
| 14 |
-
DatasetInfo,
|
| 15 |
-
Features,
|
| 16 |
-
Value,
|
| 17 |
-
SplitGenerator,
|
| 18 |
-
Split,
|
| 19 |
-
)
|
| 20 |
-
|
| 21 |
-
from datasets import DatasetBuilder, BuilderConfig, load_dataset_builder
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
import polars as pl
|
| 25 |
-
import datasets
|
| 26 |
-
from datasets import GeneratorBasedBuilder, DatasetInfo, Features, Value, Split
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
class PolarsBuilder(GeneratorBasedBuilder):
|
| 30 |
-
VERSION = datasets.Version("1.0.0")
|
| 31 |
-
|
| 32 |
-
@property
|
| 33 |
-
def df(self):
|
| 34 |
-
data_dir = self.config.data_dir
|
| 35 |
-
if data_dir is None:
|
| 36 |
-
raise ValueError("data_dir must be specified in the config")
|
| 37 |
-
return build_table(data_dir)
|
| 38 |
-
|
| 39 |
-
def _info(self):
|
| 40 |
-
feats = Features(
|
| 41 |
-
{
|
| 42 |
-
"time": Value(dtype="string", id=None),
|
| 43 |
-
"location_depth": Value(dtype="string", id=None),
|
| 44 |
-
"subject_depth": Value(dtype="string", id=None),
|
| 45 |
-
"index_rgb_depth": Value(dtype="int64", id=None),
|
| 46 |
-
"file_path_depth": Value(dtype="string", id=None),
|
| 47 |
-
"index_radar": Value(dtype="int64", id=None),
|
| 48 |
-
"location_rgb": Value(dtype="string", id=None),
|
| 49 |
-
"subject_rgb": Value(dtype="string", id=None),
|
| 50 |
-
"file_path_rgb": Value(dtype="string", id=None),
|
| 51 |
-
"location_radar": Value(dtype="string", id=None),
|
| 52 |
-
"subject_radar": Value(dtype="string", id=None),
|
| 53 |
-
"length_radar_cube": Value(dtype="int64", id=None),
|
| 54 |
-
"dimension_radar": Value(dtype="string", id=None),
|
| 55 |
-
"window_size_radar": Value(dtype="int64", id=None),
|
| 56 |
-
"window_stride_radar": Value(dtype="int64", id=None),
|
| 57 |
-
"selected_range_bin": Value(dtype="int64", id=None),
|
| 58 |
-
"enthrophy": Value(dtype="float32", id=None),
|
| 59 |
-
"file_path_radar": Value(dtype="string", id=None),
|
| 60 |
-
}
|
| 61 |
-
)
|
| 62 |
-
|
| 63 |
-
return DatasetInfo(
|
| 64 |
-
description="自定义 Builder,使用 Polars 自动推断 schema",
|
| 65 |
-
features=feats,
|
| 66 |
-
supervised_keys=None,
|
| 67 |
-
)
|
| 68 |
-
|
| 69 |
-
def _split_generators(self, dl_manager):
|
| 70 |
-
df = self.df
|
| 71 |
-
train = df
|
| 72 |
-
# train = df.sample(frac=0.9, with_replacement=False)
|
| 73 |
-
# val = df.filter(~pl.col("row_nr").is_in(train["row_nr"]))
|
| 74 |
-
return [
|
| 75 |
-
datasets.SplitGenerator(name=Split.TRAIN, gen_kwargs={"subset": train}),
|
| 76 |
-
# datasets.SplitGenerator(name=Split.VALIDATION, gen_kwargs={"subset": val}),
|
| 77 |
-
]
|
| 78 |
-
|
| 79 |
-
def _generate_examples(self, subset: pl.DataFrame):
|
| 80 |
-
# 将 Polars DataFrame 转为 Python dict 行返回
|
| 81 |
-
for idx, row in enumerate(subset.to_dicts()):
|
| 82 |
-
yield idx, row
|
| 83 |
|
| 84 |
|
| 85 |
def build_table(data_root):
|
|
@@ -87,42 +12,41 @@ def build_table(data_root):
|
|
| 87 |
radar_table = build_single_table(data_root, "radardata", parse_radar_data)
|
| 88 |
rgbdata_table = build_single_table(data_root, "rgbdata", parse_rgbdata_data)
|
| 89 |
|
| 90 |
-
depth_table
|
| 91 |
-
((pl.col("index_depth") + 1) // 2).alias("index_radar")
|
| 92 |
-
)
|
| 93 |
-
rgbdata_table = rgbdata_table.with_columns(
|
| 94 |
-
((pl.col("index_rgb") + 1) // 2).alias("index_radar")
|
| 95 |
-
)
|
| 96 |
-
# print(radar_table)
|
| 97 |
-
|
| 98 |
t1 = depth_table.join(
|
| 99 |
rgbdata_table,
|
| 100 |
-
left_on=["
|
| 101 |
-
right_on=["
|
| 102 |
-
).rename({"index_depth": "
|
| 103 |
|
| 104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
# print(t1.columns)
|
| 106 |
|
| 107 |
data_table = t1.join(
|
| 108 |
radar_table,
|
| 109 |
-
left_on=["
|
| 110 |
-
right_on=["
|
| 111 |
how="inner",
|
| 112 |
)
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
# "location": "location_depthdata",
|
| 117 |
-
# "subject": "subject_depthdata",
|
| 118 |
-
# "index_tmp": "index_rgb_depth",
|
| 119 |
-
# "index": "index_radar",
|
| 120 |
-
}
|
| 121 |
-
)
|
| 122 |
|
| 123 |
return data_table
|
| 124 |
|
| 125 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
def build_single_table(data_root, source_relatvie_root, parse_func):
|
| 127 |
data = []
|
| 128 |
for file_name in os.listdir(os.path.join(data_root, source_relatvie_root)):
|
|
@@ -141,22 +65,25 @@ def build_single_table(data_root, source_relatvie_root, parse_func):
|
|
| 141 |
|
| 142 |
def parse_depth_data(source_relatvie_root, file_name):
|
| 143 |
"""
|
| 144 |
-
|
| 145 |
"""
|
| 146 |
base_name = file_name.split(".")[0]
|
| 147 |
|
| 148 |
# Parse the base name to extract the relevant information
|
| 149 |
parts = base_name.split("-")
|
| 150 |
-
if len(parts) !=
|
| 151 |
raise ValueError(
|
| 152 |
"Base name format is incorrect. Expected format: YYYY_MM_DD_HH_MM-<other_info>-<other_info>-<other_info>"
|
| 153 |
)
|
| 154 |
|
|
|
|
| 155 |
return dict(
|
| 156 |
-
|
|
|
|
| 157 |
location_depth=parts[1],
|
| 158 |
subject_depth=parts[2],
|
| 159 |
index_depth=int(parts[3]),
|
|
|
|
| 160 |
file_path_depth=os.path.join(
|
| 161 |
source_relatvie_root, file_name
|
| 162 |
), # Use the relative path
|
|
@@ -165,19 +92,19 @@ def parse_depth_data(source_relatvie_root, file_name):
|
|
| 165 |
|
| 166 |
def parse_radar_data(source_relatvie_root, file_name):
|
| 167 |
"""
|
| 168 |
-
|
| 169 |
-
2025_06_16_21_27-mastlab-yao-1400-2D-2-2-0005-081-4.47
|
| 170 |
"""
|
| 171 |
base_name = file_name.split(".")[0]
|
| 172 |
# Parse the base name to extract the relevant information
|
| 173 |
parts = base_name.split("-")
|
| 174 |
if len(parts) != 10:
|
| 175 |
raise ValueError(
|
| 176 |
-
"Base name format is incorrect. Expected format:
|
| 177 |
)
|
| 178 |
-
|
| 179 |
return dict(
|
| 180 |
-
|
|
|
|
| 181 |
location_radar=parts[1],
|
| 182 |
subject_radar=parts[2],
|
| 183 |
length_radar_cube=int(parts[3]),
|
|
@@ -196,31 +123,48 @@ def parse_radar_data(source_relatvie_root, file_name):
|
|
| 196 |
|
| 197 |
def parse_rgbdata_data(source_relatvie_root, file_name):
|
| 198 |
"""
|
| 199 |
-
|
| 200 |
"""
|
| 201 |
|
| 202 |
base_name = file_name.split(".")[0]
|
| 203 |
|
| 204 |
# Parse the base name to extract the relevant information
|
| 205 |
parts = base_name.split("-")
|
| 206 |
-
if len(parts) !=
|
| 207 |
raise ValueError(
|
| 208 |
-
"Base name format is incorrect. Expected format:
|
| 209 |
)
|
|
|
|
| 210 |
|
| 211 |
return dict(
|
| 212 |
-
|
|
|
|
| 213 |
location_rgb=parts[1],
|
| 214 |
subject_rgb=parts[2],
|
| 215 |
index_rgb=int(parts[3]),
|
|
|
|
| 216 |
file_path_rgb=os.path.join(
|
| 217 |
source_relatvie_root, file_name
|
| 218 |
), # Use the relative path
|
| 219 |
)
|
| 220 |
|
| 221 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 222 |
if __name__ == "__main__":
|
| 223 |
data_root = os.path.dirname(os.path.abspath(__file__))
|
| 224 |
data_table = build_table(data_root)
|
|
|
|
|
|
|
| 225 |
# data_table.write_parquet("./train.parquet")
|
| 226 |
data_table.write_csv("./train.csv")
|
|
|
|
| 3 |
# depth: 2025_06_16_21_27-mastlab-yao-0001
|
| 4 |
#
|
| 5 |
import os
|
|
|
|
| 6 |
import polars as pl
|
| 7 |
+
import re
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
|
| 10 |
def build_table(data_root):
|
|
|
|
| 12 |
radar_table = build_single_table(data_root, "radardata", parse_radar_data)
|
| 13 |
rgbdata_table = build_single_table(data_root, "rgbdata", parse_rgbdata_data)
|
| 14 |
|
| 15 |
+
print(len(depth_table), len(radar_table), len(rgbdata_table))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
t1 = depth_table.join(
|
| 17 |
rgbdata_table,
|
| 18 |
+
left_on=["id", "index_depth"],
|
| 19 |
+
right_on=["id", "index_rgb"],
|
| 20 |
+
).rename({"index_depth": "index_frame"})
|
| 21 |
|
| 22 |
+
assert_columns_equal(t1, "time", "time_right")
|
| 23 |
+
t1 = t1.drop("time_right")
|
| 24 |
+
|
| 25 |
+
print(t1["index_frame"])
|
| 26 |
+
|
| 27 |
+
print(t1)
|
| 28 |
# print(t1.columns)
|
| 29 |
|
| 30 |
data_table = t1.join(
|
| 31 |
radar_table,
|
| 32 |
+
left_on=["id", "index_frame"],
|
| 33 |
+
right_on=["id", "index_radar"],
|
| 34 |
how="inner",
|
| 35 |
)
|
| 36 |
+
|
| 37 |
+
assert_columns_equal(data_table, "time", "time_right")
|
| 38 |
+
data_table = data_table.drop("time_right")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
return data_table
|
| 41 |
|
| 42 |
|
| 43 |
+
def assert_columns_equal(df, col1, col2):
|
| 44 |
+
"""Assert that two columns have identical values"""
|
| 45 |
+
are_equal = (df[col1] == df[col2]).all()
|
| 46 |
+
assert are_equal, f"Columns {col1} and {col2} are not identical"
|
| 47 |
+
print(f"✓ Columns {col1} and {col2} are identical")
|
| 48 |
+
|
| 49 |
+
|
| 50 |
def build_single_table(data_root, source_relatvie_root, parse_func):
|
| 51 |
data = []
|
| 52 |
for file_name in os.listdir(os.path.join(data_root, source_relatvie_root)):
|
|
|
|
| 65 |
|
| 66 |
def parse_depth_data(source_relatvie_root, file_name):
|
| 67 |
"""
|
| 68 |
+
769E33E0_2025_06_16_21_27-mastlab-yao-0001-1.npy
|
| 69 |
"""
|
| 70 |
base_name = file_name.split(".")[0]
|
| 71 |
|
| 72 |
# Parse the base name to extract the relevant information
|
| 73 |
parts = base_name.split("-")
|
| 74 |
+
if len(parts) != 5:
|
| 75 |
raise ValueError(
|
| 76 |
"Base name format is incorrect. Expected format: YYYY_MM_DD_HH_MM-<other_info>-<other_info>-<other_info>"
|
| 77 |
)
|
| 78 |
|
| 79 |
+
id, time_part = split_id_time(parts[0])
|
| 80 |
return dict(
|
| 81 |
+
id=id,
|
| 82 |
+
time=time_part,
|
| 83 |
location_depth=parts[1],
|
| 84 |
subject_depth=parts[2],
|
| 85 |
index_depth=int(parts[3]),
|
| 86 |
+
sub_index_depth=int(parts[4]),
|
| 87 |
file_path_depth=os.path.join(
|
| 88 |
source_relatvie_root, file_name
|
| 89 |
), # Use the relative path
|
|
|
|
| 92 |
|
| 93 |
def parse_radar_data(source_relatvie_root, file_name):
|
| 94 |
"""
|
| 95 |
+
769E33E0_2025_06_16_21_27-mastlab-yao-1400-2D-2-2-0001-076-5.90.mat
|
|
|
|
| 96 |
"""
|
| 97 |
base_name = file_name.split(".")[0]
|
| 98 |
# Parse the base name to extract the relevant information
|
| 99 |
parts = base_name.split("-")
|
| 100 |
if len(parts) != 10:
|
| 101 |
raise ValueError(
|
| 102 |
+
"Base name format is incorrect. Expected format: XXXXXXXX_YYYY_MM_DD_HH_MM-<other_info>-<other_info>-<other_info>-<other_info>-<other_info>-<other_info>"
|
| 103 |
)
|
| 104 |
+
id, time_part = split_id_time(parts[0])
|
| 105 |
return dict(
|
| 106 |
+
id=id,
|
| 107 |
+
time=time_part,
|
| 108 |
location_radar=parts[1],
|
| 109 |
subject_radar=parts[2],
|
| 110 |
length_radar_cube=int(parts[3]),
|
|
|
|
| 123 |
|
| 124 |
def parse_rgbdata_data(source_relatvie_root, file_name):
|
| 125 |
"""
|
| 126 |
+
769E33E0_2025_06_16_21_27-mastlab-yao-0001-1.npy
|
| 127 |
"""
|
| 128 |
|
| 129 |
base_name = file_name.split(".")[0]
|
| 130 |
|
| 131 |
# Parse the base name to extract the relevant information
|
| 132 |
parts = base_name.split("-")
|
| 133 |
+
if len(parts) != 5:
|
| 134 |
raise ValueError(
|
| 135 |
+
"Base name format is incorrect. Expected format: xxxx_YYYY_MM_DD_HH_MM-<other_info>-<other_info>-<other_info>-<other_info>"
|
| 136 |
)
|
| 137 |
+
id, time_part = split_id_time(parts[0])
|
| 138 |
|
| 139 |
return dict(
|
| 140 |
+
id=id,
|
| 141 |
+
time=time_part,
|
| 142 |
location_rgb=parts[1],
|
| 143 |
subject_rgb=parts[2],
|
| 144 |
index_rgb=int(parts[3]),
|
| 145 |
+
sub_index_rgb=int(parts[4]),
|
| 146 |
file_path_rgb=os.path.join(
|
| 147 |
source_relatvie_root, file_name
|
| 148 |
), # Use the relative path
|
| 149 |
)
|
| 150 |
|
| 151 |
|
| 152 |
+
def split_id_time(part):
|
| 153 |
+
pattern = r"^([0-9A-F]+)_(\d{4}_\d{2}_\d{2}_\d{2}_\d{2})$"
|
| 154 |
+
id_part, time_part = part.split("_", 1)
|
| 155 |
+
match = re.match(pattern, part)
|
| 156 |
+
if match:
|
| 157 |
+
id_part = match.group(1)
|
| 158 |
+
time_part = match.group(2)
|
| 159 |
+
return id_part, time_part
|
| 160 |
+
else:
|
| 161 |
+
raise ValueError("String format is incorrect")
|
| 162 |
+
|
| 163 |
+
|
| 164 |
if __name__ == "__main__":
|
| 165 |
data_root = os.path.dirname(os.path.abspath(__file__))
|
| 166 |
data_table = build_table(data_root)
|
| 167 |
+
print(data_table)
|
| 168 |
+
print(data_table.columns)
|
| 169 |
# data_table.write_parquet("./train.parquet")
|
| 170 |
data_table.write_csv("./train.csv")
|
depthdata/{2025_06_16_21_27-mastlab-yao-0001.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0001-1.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0002.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0001-2.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0003.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0002-1.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0004.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0002-2.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0005.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0003-1.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0006.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0003-2.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0007.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0004-1.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0008.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0004-2.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0009.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0005-1.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0010.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0005-2.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0011.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0006-1.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0012.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0006-2.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0013.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0007-1.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0014.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0007-2.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0015.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0008-1.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0016.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0008-2.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0017.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0009-1.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0018.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0009-2.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0019.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0010-1.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0020.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0010-2.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0021.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0011-1.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0022.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0011-2.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0023.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0012-1.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0024.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0012-2.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0025.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0013-1.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0026.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0013-2.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0027.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0014-1.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0028.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0014-2.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0029.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0015-1.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0030.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0015-2.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0031.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0016-1.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0032.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0016-2.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0033.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0017-1.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0034.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0017-2.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0035.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0018-1.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0036.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0018-2.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0037.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0019-1.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0038.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0019-2.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0039.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0020-1.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0040.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0020-2.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0041.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0021-1.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0042.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0021-2.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0043.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0022-1.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0044.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0022-2.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0045.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0023-1.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0046.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0023-2.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0047.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0024-1.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0048.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0024-2.npy}
RENAMED
|
File without changes
|
depthdata/{2025_06_16_21_27-mastlab-yao-0049.npy → 769E33E0_2025_06_16_21_27-mastlab-yao-0025-1.npy}
RENAMED
|
File without changes
|