Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion classify/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import sys
from pathlib import Path

import torch
import torch.backends.cudnn as cudnn
import torch.nn.functional as F

Expand Down Expand Up @@ -101,7 +102,7 @@ def run(
seen, windows, dt = 0, [], (Profile(), Profile(), Profile())
for path, im, im0s, vid_cap, s in dataset:
with dt[0]:
im = im.to(device)
im = torch.Tensor(im).to(device)
im = im.half() if model.fp16 else im.float() # uint8 to fp16/32
if len(im.shape) == 3:
im = im[None] # expand for batch dim
Expand Down