-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
45 lines (35 loc) · 1.14 KB
/
main.cpp
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
#include "PWCNet.h"
#include "Utils/logger.h"
#include <iostream>
int main() {
PWCNetParams params;
params.weightsFile = "pwcnet_trt";
params.inputTensorNames.push_back( "firstImage" );
params.inputTensorNames.push_back( "secondImage" );
params.outputTensorNames.push_back( "output" );
params.pyramidLevels = 6;
params.flowPredLevels = 2;
params.inputH = 64;
params.inputW = 64;
params.searchRange = 4;
setReportableSeverity( Logger::Severity::kINFO );
PWCNet model{ params };
gLogInfo << "Building model..." << std::endl;
if ( !model.build() )
{
gLogError << "Failed building model!" << std::endl;
}
gLogInfo << "Model built!" << std::endl;
gLogInfo << "Starting inference..." << std::endl;
if ( !model.infer() )
{
gLogError << "Failed inference!" << std::endl;
}
gLogInfo << "Inference done!" << std::endl;
gLogInfo << "Total execution time: " << model.getTotalInferenceTime() << "ms" << std::endl;
if ( !model.teardown() )
{
gLogError << "Failed teardown!" << std::endl;
}
gLogInfo << "Teardown done!" << std::endl;
}