Skip to content

Commit 0d2b2e9

Browse files
Fix indentation in dataset_viewer
Co-authored-by: Sakhineti Praveena <[email protected]>
1 parent 3a58afc commit 0d2b2e9

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

tabs/dataset_viewer.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,17 @@ def dataset_viewer_tab():
2727
return
2828

2929
# Setup paths and pagination
30-
img_dir = os.path.join(
31-
dataset_path, f"images/{split}2017" if dataset_type == "coco" else split
32-
)
30+
# Setup paths and pagination
31+
if dataset_type == "coco":
32+
img_dir = os.path.join(dataset_path, f"images/{split}2017")
3333
ann_file = os.path.join(
3434
dataset_path,
3535
"annotations",
36-
(
37-
f"instances_{split}2017.json"
38-
if dataset_type.lower() == "coco"
39-
else f"{split}.json"
40-
),
36+
f"instances_{split}2017.json",
4137
)
38+
if not os.path.isdir(img_dir) or not os.path.isfile(ann_file):
39+
st.warning("Dataset files not found. Check path and split.")
40+
return
4241

4342
if not os.path.isdir(img_dir) or not os.path.isfile(ann_file):
4443
st.warning("Dataset files not found. Check path and split.")

0 commit comments

Comments
 (0)