Open bb6698 opened 11 months ago
Hi!! I'm using Yolop with my images but I want to visualisate the result. How to could do it?
My code is:
`import torch import torchvision.transforms as transforms import cv2
normalize = transforms.Normalize( mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225] )
transform=transforms.Compose([ transforms.ToTensor(), normalize, ])
IMAGE = "/home/oem/images/image1.jpg"
image = cv2.imread(IMAGE)
resized = cv2.resize(image, (640,640), interpolation = cv2.INTER_AREA)
model = torch.hub.load('hustvl/yolop', 'yolop', pretrained=True)
img = torch.unsqueeze(transform(resized), dim=0)
det_out, da_seg_out,ll_seg_out = model(img)`
Thanks!!
You might want to check the tools/demo.py file which uses the show_seg_result function to show the result.
tools/demo.py
show_seg_result
https://github.com/hustvl/YOLOP/blob/8d8f68df318c71f01d6f813c024df646c7d1978f/lib/utils/plot.py#L24
Hi!! I'm using Yolop with my images but I want to visualisate the result. How to could do it?
My code is:
`import torch import torchvision.transforms as transforms import cv2
normalize = transforms.Normalize( mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225] )
transform=transforms.Compose([ transforms.ToTensor(), normalize, ])
IMAGE = "/home/oem/images/image1.jpg"
image = cv2.imread(IMAGE)
resized = cv2.resize(image, (640,640), interpolation = cv2.INTER_AREA)
model = torch.hub.load('hustvl/yolop', 'yolop', pretrained=True)
img = torch.unsqueeze(transform(resized), dim=0)
det_out, da_seg_out,ll_seg_out = model(img)`
Thanks!!