bodokaiser / piwise

Pixel-wise segmentation on VOC2012 dataset using pytorch.
BSD 3-Clause "New" or "Revised" License
383 stars 86 forks source link

A question about the size of output imgae #20

Open mshmoon opened 6 years ago

mshmoon commented 6 years ago

The code need input size (256 ,256) ,and output size is (256,256).This limit the ability of the practice.So I want to extend the net ability to arbitrary input size .If I do ,the code need adjustment? I can not understand the code in depth. Please help def colormap(n): cmap=np.zeros([n, 3]).astype(np.uint8)

for i in np.arange(n):
    r, g, b = np.zeros(3)

    for j in np.arange(8):
        r = r + (1<<(7-j))*((i&(1<<(3*j))) >> (3*j))
        g = g + (1<<(7-j))*((i&(1<<(3*j+1))) >> (3*j+1))
        b = b + (1<<(7-j))*((i&(1<<(3*j+2))) >> (3*j+2))

    cmap[i,:] = np.array([r, g, b])

return cmap
bodokaiser commented 6 years ago

With neural networks you can normally just use multiples of a minimal resolution as deviations will give you different output resolution from your target images because of padding.

What usually is done is to use image patches with the supported resolution and then put them together by averaging overlapping patches.

Am 15.04.2018 um 12:46 schrieb mshmoon notifications@github.com:

The code need input size (256 ,256) ,and output size is (256,256).This limit the ability of the practice.So I want to extend the net ability to arbitrary input size .But if I do ,the code need adjustment? I not absolutely understand the code. Please help .def colormap(n): cmap=np.zeros([n, 3]).astype(np.uint8)

for i in np.arange(n): r, g, b = np.zeros(3)

for j in np.arange(8):
    r = r + (1<<(7-j))*((i&(1<<(3*j))) >> (3*j))
    g = g + (1<<(7-j))*((i&(1<<(3*j+1))) >> (3*j+1))
    b = b + (1<<(7-j))*((i&(1<<(3*j+2))) >> (3*j+2))

cmap[i,:] = np.array([r, g, b])

return cmap — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.