-
Notifications
You must be signed in to change notification settings - Fork 0
/
widget.cpp
51 lines (41 loc) · 1.25 KB
/
widget.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
#include "widget.h"
#include "ui_widget.h"
#include <QFile>
#include <QFileDialog>
#include "ncs.h"
Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) {
ui->setupUi(this);
}
Widget::~Widget() { delete ui; }
void Widget::setNCS(Annotator::Plugins::NCS *ncs) { this->ncs = ncs; }
void Widget::on_graphButton_clicked() {
QString fileName = QFileDialog::getOpenFileName(this, tr("Select Graph File"),
".", tr("All (*)"));
if (QFile::exists(fileName)) {
this->ui->graphLineEdit->setText(fileName);
ncs->setGraph(fileName.toStdString());
}
}
void Widget::on_labelsButton_clicked() {
QString fileName = QFileDialog::getOpenFileName(this, tr("Select Label File"),
".", tr("All (*.*)"));
if (QFile::exists(fileName)) {
this->ui->labelLineEdit->setText(fileName);
ncs->setLabelmap(fileName.toStdString());
}
}
void Widget::on_alexNetRadioButton_toggled(bool checked) {
if (checked) {
ncs->setAlexNet();
}
}
void Widget::on_googleNetRadioButton_toggled(bool checked) {
if (checked) {
ncs->setGoogLeNet();
}
}
void Widget::on_squeezeNetRadioButton_toggled(bool checked) {
if (checked) {
ncs->setSqueezeNet();
}
}