Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -34,11 +34,14 @@ def convert_seg_to_bbox(api_key: str, dataset_url: str):
|
|
34 |
root = dataset.location # e.g. "/home/user/app/ds-2"
|
35 |
|
36 |
# --- DEBUG: print out the downloaded directory tree ---
|
37 |
-
print(f"
|
38 |
for dirpath, dirnames, filenames in os.walk(root):
|
39 |
print(f"\nDirectory: {dirpath}")
|
40 |
-
|
41 |
-
|
|
|
|
|
|
|
42 |
|
43 |
# 2) search for any JSON file with "train" in its name
|
44 |
ann_file = None
|
@@ -50,6 +53,7 @@ def convert_seg_to_bbox(api_key: str, dataset_url: str):
|
|
50 |
break
|
51 |
if ann_file:
|
52 |
break
|
|
|
53 |
if ann_file is None:
|
54 |
raise FileNotFoundError(f"No JSON file containing 'train' found under {root}")
|
55 |
|
@@ -96,6 +100,7 @@ def convert_seg_to_bbox(api_key: str, dataset_url: str):
|
|
96 |
train_img_dir = dirpath
|
97 |
print(f"Found image directory: {train_img_dir}")
|
98 |
break
|
|
|
99 |
if train_img_dir is None:
|
100 |
raise FileNotFoundError(f"No image files found under {root}")
|
101 |
|
|
|
34 |
root = dataset.location # e.g. "/home/user/app/ds-2"
|
35 |
|
36 |
# --- DEBUG: print out the downloaded directory tree ---
|
37 |
+
print(f"\n=== Downloaded dataset root: {root} ===")
|
38 |
for dirpath, dirnames, filenames in os.walk(root):
|
39 |
print(f"\nDirectory: {dirpath}")
|
40 |
+
for d in dirnames:
|
41 |
+
print(f" [DIR ] {d}")
|
42 |
+
for f in filenames:
|
43 |
+
print(f" [FILE] {f}")
|
44 |
+
print("=== end tree dump ===\n")
|
45 |
|
46 |
# 2) search for any JSON file with "train" in its name
|
47 |
ann_file = None
|
|
|
53 |
break
|
54 |
if ann_file:
|
55 |
break
|
56 |
+
|
57 |
if ann_file is None:
|
58 |
raise FileNotFoundError(f"No JSON file containing 'train' found under {root}")
|
59 |
|
|
|
100 |
train_img_dir = dirpath
|
101 |
print(f"Found image directory: {train_img_dir}")
|
102 |
break
|
103 |
+
|
104 |
if train_img_dir is None:
|
105 |
raise FileNotFoundError(f"No image files found under {root}")
|
106 |
|