-
Notifications
You must be signed in to change notification settings - Fork 89
/
visualizer.hpp
59 lines (44 loc) · 1.49 KB
/
visualizer.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef VISUALIZER_H
#define VISUALIZER_H
#include <memory>
#include <pangolin/display/view.h>
#include <pangolin/display/widgets.h>
#include <pangolin/plot/plotter.h>
#include <pangolin/var/var.h>
#include <torch/torch.h>
class Visualizer {
public:
Visualizer() = default;
~Visualizer() = default;
bool Initialize(int iter_num = -1);
void SetInitialGaussianNum(int num);
void SetLoss(int step, float loss);
void SetGaussians(const torch::Tensor& means,
const torch::Tensor& covariances,
const torch::Tensor& colors,
const torch::Tensor& opacities);
void SetImage(const torch::Tensor& rendered_img, const torch::Tensor& gt_img);
void Draw();
private:
bool DrawGaussians();
bool DrawImage();
private:
std::unique_ptr<pangolin::OpenGlRenderState> cam_state_;
std::unique_ptr<pangolin::View> point_cloud_viewer_;
std::unique_ptr<pangolin::View> render_viewer_;
std::unique_ptr<pangolin::Plotter> loss_viewer_;
pangolin::DataLog loss_log_;
std::unique_ptr<pangolin::Panel> panel_viewer_;
std::unique_ptr<pangolin::Var<int>> step_;
std::unique_ptr<pangolin::Var<int>> init_gaussian_num_;
std::unique_ptr<pangolin::Var<int>> gaussian_num_;
std::unique_ptr<pangolin::Var<float>> loss_;
std::unique_ptr<pangolin::Var<bool>> pause_button_;
torch::Tensor means_;
torch::Tensor covariances_;
torch::Tensor colors_;
torch::Tensor opacities_;
torch::Tensor rendered_img_;
torch::Tensor gt_img_;
};
#endif