forked from DataXujing/ncnn_android_yolov8
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
38 lines (27 loc) · 738 Bytes
/
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
#include "widget.h"
#include "yolo.h"
#include <QApplication>
#include <QFile>
Yolo *yolov8 = new Yolo();
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
// 加载QSS
QFile qss_(":/assets/ManjaroMix.qss");
if( qss_.open(QFile::ReadOnly)){
qDebug("open success");
QString style = QLatin1String(qss_.readAll());
a.setStyleSheet(style);
qss_.close();
}
else{
qDebug("Open failed");
}
int target_size = 640;
float norm_vals[3] = { 1 / 255.f, 1 / 255.f, 1 / 255.f };
float mean_vals[3] = { 103.53f, 116.28f, 123.675f };
yolov8->load(target_size, mean_vals,norm_vals);
Widget w;
w.show();
return a.exec();
}