digital-standard / ThreeDPoseUnityBarracuda

Unity sample of 3D pose estimation using Barracuda
1.46k stars 277 forks source link

What preprocessing has been done to the video #10

Closed hcyz33 closed 4 years ago

hcyz33 commented 4 years ago

Hello,I want to separate 3D pose estimation with onnx model and animation generation, and my results are strange. I estimated 3d pose parameter with onnx.runtime(python). but when I generate the animation, I found that all the model is inverse. I checked the process after the parameter generation, and there was no problem. I guess the problem lies in the preprocess of image .Could you tell me how you preprocessed the images here.

#here is the code I input the inputs to the model
     def infer(self, image_data):
        for t in range(3):
            #inputshape(1,3,448,448)
            #imageshape(448,448,3)
            if image_data[t].ndim == 3:
                image_data[t] = image_data[t].transpose([2, 1, 0])
                image_data[t] = np.expand_dims(image_data[t], axis=0)
                image_data[t] = image_data[t]/255
            image_data[t] = image_data[t].astype('float32')
        outputs = [output.name for output in self.session.get_outputs()]
        return self.session.run(outputs, {"input.1":image_data[0],"input.4":image_data[1],"input.7":image_data[2]})

wave

You can see that the head is inverse and her back is facing the camera

If you see it, can you reply me? Thank you!