forked from MechatronicsBlog/TensorFlowQtVPlay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tensorflowthread.h
50 lines (38 loc) · 1.08 KB
/
tensorflowthread.h
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
#ifndef TENSORFLOWTHREAD_H
#define TENSORFLOWTHREAD_H
#include <QObject>
#include <QImage>
#include <QRectF>
#include <QThread>
#include "tensorflow.h"
class WorkerTF: public QObject
{
Q_OBJECT
QImage imgTF;
Tensorflow *tf;
public:
void setImgTF(const QImage &value);
void setTf(Tensorflow *value);
public slots:
void work();
signals:
void results(int network, QStringList captions, QList<double> confidences, QList<QRectF> boxes, double time);
void finished();
};
class TensorflowThread: public QObject
{
Q_OBJECT
public:
TensorflowThread();
void run(QImage imgTF);
void setTf(Tensorflow *value);
void stop();
signals:
void results(int network, QStringList captions, QList<double> confidences, QList<QRectF> boxes, double time);
public slots:
void propagateResults(int network, QStringList captions, QList<double> confidences, QList<QRectF> boxes, double time);
private:
QThread threadTF;
WorkerTF worker;
};
#endif // TENSORFLOWTHREAD_H