Last active
November 6, 2020 20:08
-
-
Save david-littlefield/2afac3e130da4a9d87923051a66c4030 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Line 68 | |
def infer(net , img , transform , thresh , cuda , shrink): | |
if shrink != 1: | |
img = cv2.resize(img, None, None, fx=shrink, fy=shrink, interpolation=cv2.INTER_LINEAR) | |
x = torch.from_numpy(transform(img)[0]).permute(2, 0, 1) | |
with torch.no_grad(): # <---------- | |
x = Variable(x.unsqueeze(0)) # <---------- | |
if cuda: | |
x = x.cuda() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment