File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff 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." )
You can’t perform that action at this time.
0 commit comments