Spaces:
Paused
Paused
Add diagnostic logging for label mapping file loading
Browse files
code/cube3d/training/process_single_ldr.py
CHANGED
|
@@ -121,12 +121,26 @@ def onehot_to_rotation(one_hot):
|
|
| 121 |
return rotation_matrix
|
| 122 |
|
| 123 |
def load_mappings(label_mapping_file, label_inverse_mapping_file):
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
return label_mapping, label_inverse_mapping
|
| 131 |
|
| 132 |
# 读取LDR文件,逐行读取
|
|
|
|
| 121 |
return rotation_matrix
|
| 122 |
|
| 123 |
def load_mappings(label_mapping_file, label_inverse_mapping_file):
|
| 124 |
+
print(f"🔍 [DEBUG] load_mappings() called")
|
| 125 |
+
print(f" Forward file: {label_mapping_file}")
|
| 126 |
+
print(f" Inverse file: {label_inverse_mapping_file}")
|
| 127 |
+
|
| 128 |
+
try:
|
| 129 |
+
with open(label_mapping_file, 'r') as f:
|
| 130 |
+
label_mapping = json.load(f)
|
| 131 |
+
print(f" ✅ Forward mapping loaded: {len(label_mapping)} entries")
|
| 132 |
+
except Exception as e:
|
| 133 |
+
print(f" ❌ Failed to load forward mapping: {e}")
|
| 134 |
+
raise
|
| 135 |
+
|
| 136 |
+
try:
|
| 137 |
+
with open(label_inverse_mapping_file, 'r') as f:
|
| 138 |
+
label_inverse_mapping = json.load(f)
|
| 139 |
+
print(f" ✅ Inverse mapping loaded: {len(label_inverse_mapping)} entries")
|
| 140 |
+
except Exception as e:
|
| 141 |
+
print(f" ❌ Failed to load inverse mapping: {e}")
|
| 142 |
+
raise
|
| 143 |
+
|
| 144 |
return label_mapping, label_inverse_mapping
|
| 145 |
|
| 146 |
# 读取LDR文件,逐行读取
|