Spaces:
Sleeping
Sleeping
Commit
·
8a63318
1
Parent(s):
ac46e37
Minor update
Browse files
app.py
CHANGED
@@ -48,6 +48,7 @@ def inference(input_img, conf_thres, iou_thres):
|
|
48 |
with dt[0]:
|
49 |
im = letterbox(input_img, imgsz, stride=stride, auto=True)[0] # padded resize
|
50 |
im = im.transpose((2, 0, 1))[::-1]
|
|
|
51 |
im = torch.from_numpy(im).to(model.device)
|
52 |
im = im.half() if model.fp16 else im.float() # uint8 to fp16/32
|
53 |
im /= 255 # 0 - 255 to 0.0 - 1.0
|
|
|
48 |
with dt[0]:
|
49 |
im = letterbox(input_img, imgsz, stride=stride, auto=True)[0] # padded resize
|
50 |
im = im.transpose((2, 0, 1))[::-1]
|
51 |
+
im = np.ascontiguousarray(im)
|
52 |
im = torch.from_numpy(im).to(model.device)
|
53 |
im = im.half() if model.fp16 else im.float() # uint8 to fp16/32
|
54 |
im /= 255 # 0 - 255 to 0.0 - 1.0
|