-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
119 lines (98 loc) · 3.08 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#include <iostream>
#include <opencv2/opencv.hpp>
#include "test_1.h"
#include "ll_enhancement_algorithm.h"
using namespace cv;
int main() {
// std::cout << "Test show image with OPENCV LIB" << std::endl;
// return test_1(); # The test for showing the image with OPENCV in UBUNTU
std::cout << "============= Inference in CPU with C =============";
// Silent cv
cv::utils::logging::setLogLevel(cv::utils::logging::LogLevel::LOG_LEVEL_SILENT);
//initialMem();
//cvReadImg();
//return 0;
std::string test_img_path = "/home/trongan93/Projects/LowLightEnhanceOnBoard/QuantizedZeroDCE_CPP/paper_case2/_mnt_d_Seaport_satellite_images_lng_4.240000_lat_51.520000_sentinel_2_rgb.png";
std::string write_img_test_path = "/home/trongan93/Projects/LowLightEnhanceOnBoard/QuantizedZeroDCE_CPP/paper_case2/_mnt_d_Seaport_satellite_images_lng_4.240000_lat_51.520000_sentinel_2_rgb_enhanced_onboard.png";
clock_t t;
double elapse;
printf("Start initialMem\n");
t = clock();
initialMem();
t = clock() - t;
elapse = ((double)t) / CLOCKS_PER_SEC;
printf("%f s\n", elapse);
printf("Start cvReadImg\n");
t = clock();
cvReadImg(test_img_path);
t = clock() - t;
elapse = ((double)t) / CLOCKS_PER_SEC;
printf("%f s\n", elapse);
printf("Start qLoadParam\n");
t = clock();
qLoadParam();
t = clock() - t;
elapse = ((double)t) / CLOCKS_PER_SEC;
printf("%f s\n", elapse);
printf("Start qNorm_256\n");
t = clock();
qNorm_256();
t = clock() - t;
elapse = ((double)t) / CLOCKS_PER_SEC;
printf("%f s\n", elapse);
printf("Start qDownSample\n");
t = clock();
qDownSample();
t = clock() - t;
elapse = ((double)t) / CLOCKS_PER_SEC;
printf("%f s\n", elapse);
printf("Start qConv1st\n");
t = clock();
qConv1st();
t = clock() - t;
elapse = ((double)t) / CLOCKS_PER_SEC;
printf("%f s\n", elapse);
printf("Start qConv2nd\n");
t = clock();
qConv2nd();
t = clock() - t;
elapse = ((double)t) / CLOCKS_PER_SEC;
printf("%f s\n", elapse);
printf("Start qConv3rdV2\n");
t = clock();
qConv3rdV2();
t = clock() - t;
elapse = ((double)t) / CLOCKS_PER_SEC;
printf("%f s\n", elapse);
printf("Start qUpSample\n");
t = clock();
qUpSample();
t = clock() - t;
elapse = ((double)t) / CLOCKS_PER_SEC;
printf("%f s\n", elapse);
printf("Start qEnhance_256\n");
t = clock();
qEnhance_256();
t = clock() - t;
elapse = ((double)t) / CLOCKS_PER_SEC;
printf("%f s\n", elapse);
printf("Start cvOutputImg\n");
t = clock();
cvOutputImg();
t = clock() - t;
elapse = ((double)t) / CLOCKS_PER_SEC;
printf("%f s\n", elapse);
printf("Write to file writeImageData\n");
t = clock();
writeImageData(write_img_test_path);
t = clock() - t;
elapse = ((double)t) / CLOCKS_PER_SEC;
printf("%f s\n", elapse);
printf("Start clenaMem\n");
t = clock();
cleanMem();
t = clock() - t;
elapse = ((double)t) / CLOCKS_PER_SEC;
printf("%f s\n", elapse);
return 0;
}