Comments (1)
Wrote drawer myself. If anyone needs it, here. THough it should be mentioned, that in my case i've inferenced model with seq_length 5 and it saved tons of files in the eval folder. If you somehow test this model other way, you'll probably need to change the code.
import os
import numpy as np
import matplotlib.pyplot as plt
path_to_poses = "/home/daddywesker/TestingNeuralSlam/GeoNet/eval/Pose/"
plt.switch_backend('agg')
def get_matrix_from_quat(quat):
"""Create a 4x4 homography matrix that represents the rotation
of the quaternion.
"""
#quat - x, y, z, qx, qy, qz, qw
# Init matrix (remember, a matrix, not an array)
a = np.zeros((4, 4), dtype=np.float32)
quat = [float(x) for x in quat]
x, y, z, qx, qy, qz, qw = quat
# First row
a[0, 0] = - 2.0 * (qy * qy + qz * qz) + 1.0
a[1, 0] = + 2.0 * (qx * qy + qz * qw)
a[2, 0] = + 2.0 * (qx * qz - qy * qw)
a[3, 0] = 0.0
# Second row
a[0, 1] = + 2.0 * (qx * qy - qz * qw)
a[1, 1] = - 2.0 * (qx * qx + qz * qz) + 1.0
a[2, 1] = + 2.0 * (qz * qy + qx * qw)
a[3, 1] = 0.0
# Third row
a[0, 2] = + 2.0 * (qx * qz + qy * qw)
a[1, 2] = + 2.0 * (qy * qz - qx * qw)
a[2, 2] = - 2.0 * (qx * qx + qy * qy) + 1.0
a[3, 2] = 0.0
# Fourth row
a[0, 3] = x
a[1, 3] = y
a[2, 3] = z
a[3, 3] = 1.0
return a
res = sorted(os.listdir(path_to_poses))
opened = open(path_to_poses + res[0])
pose0 = opened.readline()
H0 = get_matrix_from_quat(pose0.split("\n")[0].split(" ")[1:])
traj = []
traj.append(np.asarray([H0[0, 3], H0[1, 3]]))
for i in range (4, len(res), 4):
opened = open(path_to_poses + res[i])
pose = opened.readlines()[-1]
HLast = get_matrix_from_quat(pose.split("\n")[0].split(" ")[1:])
H0 = np.matmul(H0, HLast)
traj.append(np.asarray([H0[0, 3], H0[1, 3]]))
traj = np.asarray(traj)
plt.scatter(traj[:, 0], traj[:, 1])
plt.savefig('traj.jpg')
from geonet.
Related Issues (20)
- Output problem HOT 5
- training problem HOT 1
- How to use optical flow model to test my videos? HOT 1
- Error while camera pose testing HOT 11
- Version of GeoNet HOT 2
- pretrained model problems HOT 1
- about flow_test. HOT 1
- Creating ORB-SLAM (full) snippets HOT 4
- Hello, author. Some problems about generating training model.
- Upgrading tf.contrib.slim to tf 2.0 HOT 2
- How to get depth ground-truth HOT 3
- Loss and training of the Rigid Structure Reconstructor HOT 3
- About FLOPs and parameters HOT 1
- No response in training process HOT 4
- ckpt file problem HOT 2
- How are target and source frames selected? HOT 1
- Could you provide the fps of your model?
- is:issue is:open How do I view the loss curve and why there is no loss output?thanks.
- Is there a version that supports Python 3.11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geonet.