Update tools/demo_api.py
Browse files- tools/demo_api.py +1 -1
tools/demo_api.py
CHANGED
@@ -74,7 +74,7 @@ class Predictor(object):
|
|
74 |
img_info["raw_img"] = img
|
75 |
|
76 |
ratio = min(self.test_size[0] / img.shape[0], self.test_size[1] / img.shape[1])
|
77 |
-
pad = [0,0,0,0]
|
78 |
pad[1] = ( self.test_size[0] - img.shape[0] * ratio ) / 2
|
79 |
pad[0] = ( self.test_size[1] - img.shape[1] * ratio ) / 2
|
80 |
pad[2] = pad[0]
|
|
|
74 |
img_info["raw_img"] = img
|
75 |
|
76 |
ratio = min(self.test_size[0] / img.shape[0], self.test_size[1] / img.shape[1])
|
77 |
+
pad = torch.tensor([0,0,0,0])
|
78 |
pad[1] = ( self.test_size[0] - img.shape[0] * ratio ) / 2
|
79 |
pad[0] = ( self.test_size[1] - img.shape[1] * ratio ) / 2
|
80 |
pad[2] = pad[0]
|