Spaces:
Build error
Build error
Update lib/dataset/DemoDataset.py
Browse files
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 |
-
|
| 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 |
-
|
| 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)
|