hank1996 commited on
Commit
e09d442
·
1 Parent(s): 5db4696

Update lib/dataset/DemoDataset.py

Browse files
Files changed (1) hide show
  1. lib/dataset/DemoDataset.py +4 -2
lib/dataset/DemoDataset.py CHANGED
@@ -110,7 +110,7 @@ class LoadImages: # for inference
110
  path = self.files[self.count]
111
  self.new_video(path)
112
  ret_val, img0 = self.cap.read()
113
- h0, w0 = img0.shape[:2]
114
 
115
  self.frame += 1
116
  print('\n video %g/%g (%g/%g) %s: ' % (self.count + 1, self.nf, self.frame, self.nframes, path), end='')
@@ -122,9 +122,11 @@ class LoadImages: # for inference
122
  #img0 = cv2.cvtColor(img0, cv2.COLOR_BGR2RGB)
123
  assert img0 is not None, 'Image Not Found ' + path
124
  print('image %g/%g %s: \n' % (self.count, self.nf, path), end='')
125
- h0, w0 = img0.shape[:2]
126
 
127
  # Padded resize
 
 
128
  img, ratio, pad = letterbox_for_img(img0, new_shape=self.img_size, auto=True)
129
  h, w = img.shape[:2]
130
  shapes = (h0, w0), ((h / h0, w / w0), pad)
 
110
  path = self.files[self.count]
111
  self.new_video(path)
112
  ret_val, img0 = self.cap.read()
113
+
114
 
115
  self.frame += 1
116
  print('\n video %g/%g (%g/%g) %s: ' % (self.count + 1, self.nf, self.frame, self.nframes, path), end='')
 
122
  #img0 = cv2.cvtColor(img0, cv2.COLOR_BGR2RGB)
123
  assert img0 is not None, 'Image Not Found ' + path
124
  print('image %g/%g %s: \n' % (self.count, self.nf, path), end='')
125
+
126
 
127
  # Padded resize
128
+ h0, w0 = img0.shape[:2]
129
+ img0 = cv2.resize(img0,(1280,720),interpolation = cv2.INTER_LINEAR)
130
  img, ratio, pad = letterbox_for_img(img0, new_shape=self.img_size, auto=True)
131
  h, w = img.shape[:2]
132
  shapes = (h0, w0), ((h / h0, w / w0), pad)