Skip to content

Instantly share code, notes, and snippets.

@arunm8489
Created June 5, 2020 02:24
Show Gist options
  • Save arunm8489/62003b477368e17f567d79efbb191716 to your computer and use it in GitHub Desktop.
Save arunm8489/62003b477368e17f567d79efbb191716 to your computer and use it in GitHub Desktop.
img = cv2.imread("dog-cycle-car.png")
img = cv2.resize(img, (416,416))
img = cv2.cvtColor(img,cv2.COLOR_BGR2RGB)
img = img.transpose((2,0,1))
img = img[np.newaxis,:,:,:]/255.0
img = torch.from_numpy(img).float()
model = Darknet("yolov3.cfg")
pred = model(img, torch.cuda.is_available())
print(pred.shape)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment