InferPipeline.h 864 Bytes
Newer Older
Nianchen Deng's avatar
Nianchen Deng committed
1
#pragma once
Nianchen Deng's avatar
sync    
Nianchen Deng committed
2
#include "../utils/common.h"
Nianchen Deng's avatar
Nianchen Deng committed
3
4
5
6
7
#include "../msl_infer/Sampler.h"
#include "../msl_infer/Encoder.h"
#include "../msl_infer/Renderer.h"
#include "../msl_infer/Msl.h"

Nianchen Deng's avatar
sync    
Nianchen Deng committed
8
9
class InferPipeline {
  public:
Nianchen Deng's avatar
Nianchen Deng committed
10
    InferPipeline(sptr<Msl> net, unsigned int nRays, unsigned int nSamplesPerRay,
Nianchen Deng's avatar
sync    
Nianchen Deng committed
11
                  glm::vec2 depthRange, int encodeDim, int coordChns);
Nianchen Deng's avatar
Nianchen Deng committed
12

Nianchen Deng's avatar
sync    
Nianchen Deng committed
13
14
    void run(sptr<CudaArray<glm::vec4>> o_colors, sptr<CudaArray<glm::vec3>> rays, glm::vec3 origin,
             bool showPerf = false);
Nianchen Deng's avatar
Nianchen Deng committed
15

Nianchen Deng's avatar
sync    
Nianchen Deng committed
16
  private:
Nianchen Deng's avatar
Nianchen Deng committed
17
18
19
    unsigned int _nRays;
    unsigned int _nSamplesPerRay;
    unsigned int _coordChns;
Nianchen Deng's avatar
sync    
Nianchen Deng committed
20
    sptr<Msl> _net;
Nianchen Deng's avatar
Nianchen Deng committed
21
22
23
    sptr<Sampler> _sampler;
    sptr<Encoder> _encoder;
    sptr<Renderer> _renderer;
Nianchen Deng's avatar
sync    
Nianchen Deng committed
24
    sptr<CudaArray<float>> _coords;
Nianchen Deng's avatar
Nianchen Deng committed
25
26
27
28
    sptr<CudaArray<float>> _depths;
    sptr<CudaArray<float>> _encoded;
    sptr<CudaArray<glm::vec4>> _layeredColors;
};