pytorch / android-demo-app

PyTorch android examples of usage in applications
1.47k stars 606 forks source link

exporting keypoint_rcnn_fbnetv3a_dsmask_C4 pretrained model using create_d2go.py #122

Open sadegh16 opened 3 years ago

sadegh16 commented 3 years ago

Hello all

Could anyone ever export torchscript file for keypoint_rcnn_fbnetv3a_dsmask_C4 pre-trained model using create_d2go.py file? I altered the Wrapper to return "keypoints" beside others ("boxes","scores","labels"). "Keypoints" are in the out[3] in Wrapper. res["scores"] = out[2] when I use exported .pt file in android I get corrupted keypoints coordinates and it seems it's due to the TracerWarnings meanwhile I export torchscript file ( Converting a tensor to other python types cause the value to be constant in the torchscript output file)

I am pretty sure the input format of the forwarding path in android is correct. The output of the model in android for keypoint_rcnn_fbnetv3a_dsmask_C4 model is "boxes","scores","labels","keypoints". but "keypoints" are not correct. others are fine.

** my meaning of corrupted keypoints : for each keypoint the model in android returns the same (x,y,probability)

jeffxtang commented 3 years ago

@fmassa please take a look?