Diffrent data structure option for Top to Chop

Maybe i`m missing something,
Given texture
I want to transfer its pixels
to be a vector inside a long array.
[(r1,g1,b1),(r2,g2,b2)…]

Currently when i try to use shuffle tricks \ logic it seem to slow down everything .
(please fix me if i`m wrong)

What if the top to chop will offer other transfer structures than the current single one ?

keep up the great work
(added simple example for my current solution to transfer image to opencv structure)
Barak.
texture_to_numpy.toe (4.2 KB)

Your network seems to have no obvious bottlenecks now.
Where are you seeing the slowdown?

Hi Rob,

If you will pass 1024x1024 texture (do it on the constant1 node).
You will notice two things.

1.shuffle will cost 1-2 ms of process.

  1. the current top to chop structure force us to use:
rgb = np.dstack((node[0].vals,node[1].vals,node[2].vals))

(docs.scipy.org/doc/numpy/refere … stack.html)
numpy.dstack ~double the process time compare if we just used direct assignment.

From 1 and 2 :
I think we can have > 2X faster results (still in python realm)
if the top to chop will introduce more data structures as mention in the RFE.
Instead of using numpy.dstack,
we will just have to use :
numpy.asarray.html
docs.scipy.org/doc/numpy-1.13.0 … array.html

To summarize we can expect general higher performance for many use cases
if top to chop will introduce more options for its conversion structure.
that suites opencv, numpy and maybe matlab too.

Seems like i`m wrong about the structure i want, still, I think
the RFE can be valid.
Need to look over the swap channels and samples. :confused: