Comments

You must log in or register to comment.

robbsc t1_iziz6ie wrote

I don't have the time to figure it out, but I'm pretty sure you can do it through some combination of permutations and reshapes. Play around with an NxN numpy array (e.g. np.arange(8**2).reshape(8,8)) and perform various transposes and reshapes and see what comes out. You might have to add and remove an axis at some point too.

1

webbersknee t1_izjjea6 wrote

Skimage view_as_windows would do this.

2

saw79 t1_izjv9wa wrote

Sometimes that beautiful one-liner just isn't worth it compared to something like

torch.cat((
    img[:N, :N],
    img[N:, :N],
    img[:N, N:],
    img[N:, N:],
    ), dim=-1)
3

Final-Rush759 t1_izkyfql wrote

Use convnet to transform to the right shape

1

Final-Rush759 t1_izkyupf wrote

Use convnet to transform to the right shape. May need to use dilution.

1