dxl952@case.edu commited on
Commit ·
c7925c3
1
Parent(s): 6245d0f
udpate Causal3D Loader
Browse files- Causal3D.py +3 -5
Causal3D.py
CHANGED
|
@@ -91,10 +91,9 @@ class Causal3D(datasets.GeneratorBasedBuilder):
|
|
| 91 |
scene = parts[2]
|
| 92 |
scene_path = os.path.join(category, scene)
|
| 93 |
|
| 94 |
-
|
| 95 |
-
if os.path.exists(scene_path): # 本地路径直接用
|
| 96 |
data_dir = scene_path
|
| 97 |
-
else:
|
| 98 |
archive_path = dl_manager.download_and_extract(f"{scene_path}.zip")
|
| 99 |
data_dir = os.path.join(archive_path, scene)
|
| 100 |
|
|
@@ -107,8 +106,7 @@ class Causal3D(datasets.GeneratorBasedBuilder):
|
|
| 107 |
def _generate_examples(self, data_dir):
|
| 108 |
def color(text, code):
|
| 109 |
return f"\033[{code}m{text}\033[0m"
|
| 110 |
-
print("load data from {}".format(data_dir))
|
| 111 |
-
# Load image paths
|
| 112 |
try:
|
| 113 |
image_files = {}
|
| 114 |
for ext in ("*.png", "*.jpg", "*.jpeg"):
|
|
|
|
| 91 |
scene = parts[2]
|
| 92 |
scene_path = os.path.join(category, scene)
|
| 93 |
|
| 94 |
+
if os.path.exists(scene_path):
|
|
|
|
| 95 |
data_dir = scene_path
|
| 96 |
+
else:
|
| 97 |
archive_path = dl_manager.download_and_extract(f"{scene_path}.zip")
|
| 98 |
data_dir = os.path.join(archive_path, scene)
|
| 99 |
|
|
|
|
| 106 |
def _generate_examples(self, data_dir):
|
| 107 |
def color(text, code):
|
| 108 |
return f"\033[{code}m{text}\033[0m"
|
| 109 |
+
print("load data from {}".format(data_dir))
|
|
|
|
| 110 |
try:
|
| 111 |
image_files = {}
|
| 112 |
for ext in ("*.png", "*.jpg", "*.jpeg"):
|