Spaces:
Runtime error
Runtime error
Zhao Xiaoming
commited on
Commit
·
fb19a40
1
Parent(s):
688064e
COLOR_BGR2RGB
Browse files
demo.py
CHANGED
@@ -54,8 +54,7 @@ class ImageLoader(object):
|
|
54 |
filename = self.images[item]
|
55 |
img = cv2.imread(filename)
|
56 |
if img is None:
|
57 |
-
raise Exception('Error reading image %s' % filename)
|
58 |
-
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
59 |
return img
|
60 |
|
61 |
def __len__(self):
|
@@ -143,8 +142,9 @@ if __name__ == '__main__':
|
|
143 |
for img in progress_bar:
|
144 |
if img is None:
|
145 |
break
|
146 |
-
|
147 |
-
|
|
|
148 |
kpts = pred['keypoints']
|
149 |
desc = pred['descriptors']
|
150 |
runtime.append(pred['time'])
|
|
|
54 |
filename = self.images[item]
|
55 |
img = cv2.imread(filename)
|
56 |
if img is None:
|
57 |
+
raise Exception('Error reading image %s' % filename)
|
|
|
58 |
return img
|
59 |
|
60 |
def __len__(self):
|
|
|
142 |
for img in progress_bar:
|
143 |
if img is None:
|
144 |
break
|
145 |
+
|
146 |
+
img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
147 |
+
pred = model(img_rgb, sub_pixel=not args.no_sub_pixel)
|
148 |
kpts = pred['keypoints']
|
149 |
desc = pred['descriptors']
|
150 |
runtime.append(pred['time'])
|