zoheb commited on
Commit
b18860c
·
1 Parent(s): 203a497

second commit

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -102,8 +102,8 @@ def predict_on_frames(dir, mod_dir):
102
  #for sorting the file names properly
103
  files.sort(key = lambda x: int(x.stem[6:]))
104
 
105
- for i in stqdm(range(len(files)), desc="Generating... this is a slow task"):
106
- filename = Path(dir, files[i])
107
  #print(filename)
108
  #reading each files
109
  img = Image.open(str(filename))
@@ -112,7 +112,7 @@ def predict_on_frames(dir, mod_dir):
112
  pixel_values = img_ftr["pixel_values"].to(device)
113
  # forward pass to get class logits and bounding boxes
114
  outputs = model_pt(pixel_values=pixel_values)
115
- mod_img_path = Path(mod_dir, files[i].name)
116
  save_predictions(img, outputs, mod_img_path)
117
 
118
  # Convert frames to video
 
102
  #for sorting the file names properly
103
  files.sort(key = lambda x: int(x.stem[6:]))
104
 
105
+ for file in stqdm(files, desc="Generating... this is a slow task"):
106
+ filename = Path(dir, file)
107
  #print(filename)
108
  #reading each files
109
  img = Image.open(str(filename))
 
112
  pixel_values = img_ftr["pixel_values"].to(device)
113
  # forward pass to get class logits and bounding boxes
114
  outputs = model_pt(pixel_values=pixel_values)
115
+ mod_img_path = Path(mod_dir, file.name)
116
  save_predictions(img, outputs, mod_img_path)
117
 
118
  # Convert frames to video