mmdeploy
mmdeploy copied to clipboard
Convert mmpose:TopDownAffine Transform to cuda compatible
mmdeploy/csrc/mmdeploy/codebase/mmpose/topdown_affine.cpp
I am trying to modify the above file to allow preprocessing on cuda.
The model I am using is HRNet.
TopDownAffine uses cv2.warpaffine, but at inference it only performs crop and resize, so this could be easily changed to a cuda compatible transform.
Before doing that, is there a way to quickly put in an existing cuda-resize Transform to replace TopDownAffine in the pipeline and look at the potential speed gain?
My current workflow is:
- Rewrite .cpp code at topdown_affine.cpp to perform resize, and import from the cuda kernel here.
- Rebuild tensorRT using commands here
- Reconvert model with tools/deploy.py
@lvhan028
You can have a look for pipeline.json
. There is a field names transforms
in tasks. You could rearange transforms here. But for postprocess in mmpose, it uses the scale
and center
which is calculated on preprocess, so you may need to rewrite the code here too.
You could provide your simplified preprocessing / postprocess code here and we can think how to add it to the cpp code.
Currently, the TopDownAffine
can be processed on gpu.