-
Notifications
You must be signed in to change notification settings - Fork 1
/
widget.cpp
50 lines (40 loc) · 1.57 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
#include "widget.h"
#include <QtWidgets/QFileDialog>
#include "ssd.h"
#include "ui_widget.h"
Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) {
ui->setupUi(this);
}
Widget::~Widget() { delete ui; }
void Widget::setSSD(Annotator::Plugins::SSD *ssd) { this->ssd = ssd; }
void Widget::on_prototxtButton_clicked() {
QString fileName = QFileDialog::getOpenFileName(
this, tr("Load Caffe prototxt File"), "", tr("model (*.prototxt)"));
ui->prototxtLineEdit->setText(fileName);
ssd->setPrototxt(fileName.toStdString());
}
void Widget::on_caffemodelButton_clicked() {
QString fileName =
QFileDialog::getOpenFileName(this, tr("Load Caffemodel File"), "",
tr("caffemodel weights (*.caffemodel)"));
ui->caffemodelLineEdit->setText(fileName);
ssd->setCaffemodel(fileName.toStdString());
}
void Widget::on_confidenceSpinBox_editingFinished() {
ssd->setConfidenceThreshold(ui->confidenceSpinBox->value());
}
void Widget::on_prototxtLineEdit_editingFinished() {
ssd->setPrototxt(ui->prototxtLineEdit->text().toStdString());
}
void Widget::on_caffemodelLineEdit_editingFinished() {
ssd->setCaffemodel(ui->caffemodelLineEdit->text().toStdString());
}
void Widget::on_labelmapButton_clicked() {
QString fileName = QFileDialog::getOpenFileName(
this, tr("Load Caffe label map File"), "", tr("model (*.prototxt)"));
ui->labelmapLineEdit->setText(fileName);
ssd->setLabelmap(fileName.toStdString());
}
void Widget::on_labelmapLineEdit_editingFinished() {
ssd->setLabelmap(ui->labelmapLineEdit->text().toStdString());
}