Xilinx / QNN-MO-PYNQ

BSD 3-Clause "New" or "Revised" License
236 stars 114 forks source link

Is your network trained with swapped X / Y axis ?? #22

Closed Pe3ucTop closed 5 years ago

Pe3ucTop commented 5 years ago

Hello, Analyzing your provided Python code I came to : Image loaded array axes (shape) (3,h,w) = [Color, Y, X] , it's ok then going img_copy = np.swapaxes(img_copy, 0,2) with result [X,Y,C] <- Not Ok for most image operations then in utils.conv_layer transpose(0, 3, 1, 2) on [1,X,Y,C] with result [1,C,X,Y] <- here it not ok for Darknet too.. And then you get elements for convolution like from correctly positioned image ... After buffer prepare, same data (with incorrect convolution direction is passed to Accelerator) ..

Could you comment on that ??

Also I tried loading "dog.jpg" image whith OpenCV , it give me better result. But OpenCV have different colour space BGR (not RGB) , did you use RGB for training ?

nickfraser commented 5 years ago

This network was trained in darknet. The preprocessing code is the same as darknet, and therefore I suggest you look the their preprocessing techniques.