ternaus/TernausNetV2

result Wrong

robeson1010 opened this issue · 6 comments

image

Hi, I have used your weight and predict the same TIF. Why the result looks so weild?

I confirm this weird behavior. The reason is unclear yet.

Most likely it is related to the nvidia drivers / cuda / pytorch version.

I used pytorch 0.4 cuda 9.0 and a K80 GPU。 It looks very weird. Can you show your trainning process that I can get my own weight?

It looks like a bug in the

https://pytorch.org/docs/stable/_modules/torchvision/transforms/transforms.html#ToTensor

It does not convert to the [0, 1] range

Right now you can just divide input image by 255.

input_img = torch.unsqueeze(img_transform(img / 255).cuda(), dim=0)

Thanks ternaus. It works. Another question. Can you tell me how to make the mask in which we predict areas of an image where different objects touch or very close to each other from the building mask.

def create_contour(labels):
    mask = labels.copy()
    mask[mask > 0] = 1
    dilated = binary_dilation(mask, iterations=4)
    mask_wl = watershed(dilated, labels, mask=dilated, watershed_line=True)
    mask_wl[mask_wl > 0] = 1
    contours = dilated - mask_wl
    contours = binary_dilation(contours, iterations=3)
    return contours

Thanks