tusen-ai / simpledet

A Simple and Versatile Framework for Object Detection and Instance Recognition
Apache License 2.0
3.08k stars 488 forks source link

Any plan to support DeformableConvolution and DeformablePSROIPooling? #240

Closed ACkuku closed 5 years ago

ACkuku commented 5 years ago

Official MxNet DeformablePSROIPooling accept rois is 2D array[[batch_index, x1, y1, x2, y2]], and simpledet rois(proposals) is 3D array, how to solve this? Thanks~

huangzehao commented 5 years ago

Note batch_image=B, image_roi=N, then the shape of simpledet rois is [B, N, 4]. You can convert [B, N, 4] into [B*N, 5] by the following codes:

B = 10
N = 5
rois = mx.nd.ones((B, N, 4))
rois = mx.nd.reshape(rois, (-1, 4))
batch_ind = mx.nd.arange(B)
batch_ind = mx.nd.repeat(batch_ind, N)
batch_ind = mx.nd.expand_dims(batch_ind, axis=-1)
rois = mx.nd.concat(batch_ind, rois, dim=1)
ACkuku commented 5 years ago

thank you very much~