ClementPinard / SfmLearner-Pytorch

Pytorch version of SfmLearner from Tinghui Zhou et al.
MIT License
1.01k stars 224 forks source link

visualize pose #120

Closed JIAJIAqi-1 closed 3 years ago

JIAJIAqi-1 commented 3 years ago

Hi! Thank you for your work again. I have read #82 and #39 . Then, I did the following code and used predications.npy published on https://drive.google.com/drive/folders/1H1AFqSS8wr_YzwG2xWwAQHTfXN5Moxmx. But the result I got is quite different from groundtruth. I'm not sure where the problem is. Could you help me to solve it?

import numpy as np
import matplotlib.pyplot as plt
plt.switch_backend('agg')
data = np.load("predictions.npy")
for i in range(1,len(data)):
    r = data[i - 1, 1]
    data[i] = r[:, :3] @ data[i]
    data[i, :, :, -1] = data[i, :, :, -1] + r[:, -1]
groundtruth = []
for i in range(0, 5):
    x = data[0, i, 0, 3]
    z = data[0, i, 2, 3]
    groundtruth = np.append(groundtruth, [x, z])
for i in range(1, 1201):
    x = data[i, 4, 0, 3]
    z = data[i, 4, 2, 3]
    groundtruth = np.append(groundtruth, [x, z])
g = groundtruth.reshape(1205, 2)
plt.scatter(g[:, 0], g[:, 1])
plt.savefig('09.jpg')

09

JIAJIAqi-1 commented 3 years ago

Oh, I suddenly realized that this is the trajectory of sequence10 but not 09. I'm very sorry that I made such a stupid mistake:(