Smriti77 commited on
Commit
e827563
·
verified ·
1 Parent(s): 955e05d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -8
app.py CHANGED
@@ -30,17 +30,14 @@ if os.path.exists(JSON_PATH):
30
  dataset = json.load(f)
31
 
32
  for item in dataset:
33
-
34
  category = item["category"].lower().replace(" ", "_")
35
 
36
-
37
- video_filename = os.path.basename(item["video_clip_path"])
38
- item["video_clip_path"] = f"{DATASET_PATH}/clips/{category}/{video_filename}"
39
-
40
-
41
- frame_filename = os.path.basename(item["frame_path"])
42
- item["frame_path"] = f"{DATASET_PATH}/all_signs/{frame_filename}"
43
 
 
 
44
  else:
45
 
46
  dataset = []
 
30
  dataset = json.load(f)
31
 
32
  for item in dataset:
 
33
  category = item["category"].lower().replace(" ", "_")
34
 
35
+ # Convert absolute paths to relative ones
36
+ if item["video_clip_path"].startswith("/content/sign_language_dataset/"):
37
+ item["video_clip_path"] = item["video_clip_path"].replace("/content/sign_language_dataset/", f"{DATASET_PATH}/")
 
 
 
 
38
 
39
+ if item["frame_path"].startswith("/content/sign_language_dataset/"):
40
+ item["frame_path"] = item["frame_path"].replace("/content/sign_language_dataset/", f"{DATASET_PATH}/")
41
  else:
42
 
43
  dataset = []