aim-uofa / AdelaiDet

AdelaiDet is an open source toolbox for multiple instance-level detection and recognition tasks.
https://git.io/AdelaiDet
Other
3.37k stars 647 forks source link

How do we understand '_C' in adet? #603

Closed IncludeMathH closed 1 year ago

IncludeMathH commented 1 year ago

Sometimes you see snippets of code like this: DETR

from adet import _C
...
class _MSDeformAttnFunction(torch.autograd.Function):
    @staticmethod
    def forward(ctx, value, value_spatial_shapes, value_level_start_index, sampling_locations, attention_weights, im2col_step):

        output = _C.ms_deform_attn_forward(
            value, value_spatial_shapes, value_level_start_index, sampling_locations, attention_weights, ctx.im2col_step)

So what exactly does _C stand for? Where is the source code for this part?

Zalways commented 1 year ago

hi ! same confusion,canyou talk about your views thanks!

IncludeMathH commented 1 year ago

According to my understanding, this _C represents some programs written in CUDA language. In the DETR I described, the relevant files are in the csrc folder.

Zalways commented 1 year ago

thanks you!you are so warmhearted, and i try to export a model based detr into torchscript,but met some problem, have you export the model into other format (like onnx,torchscript etc.) before? i want to find some help from someone who is experienced.

IncludeMathH commented 1 year ago

没有试过,我也只是初学者。