mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 17:40:23 +08:00
GlobalDescriptor (PyDescriptor / netvlad) (#1163)
* First commit for pydescriptor * Fixed Python refactoring errors * GUI: added PyDescriptor parameters * reordered python3 includes * updated rtabmap_netvlad.py test main * fixed build from last merge * integrated https://github.com/introlab/rtabmap/pull/1255 * rescaled dot product result Closing https://github.com/introlab/rtabmap/issues/1105
This commit is contained in:
@@ -263,6 +263,7 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
|
||||
_ui->comboBox_detector_strategy->setItemData(15, 0, Qt::UserRole - 1);
|
||||
_ui->vis_feature_detector->setItemData(15, 0, Qt::UserRole - 1);
|
||||
_ui->reextract_nn->setItemData(6, 0, Qt::UserRole - 1);
|
||||
_ui->comboBox_globalDescriptorExtractor->setItemData(1, 0, Qt::UserRole - 1);
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_OPENCV_XFEATURES2D) || (CV_MAJOR_VERSION == 3 && (CV_MINOR_VERSION<4 || CV_MINOR_VERSION==4 && CV_SUBMINOR_VERSION<1))
|
||||
@@ -971,6 +972,8 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
|
||||
// Create hypotheses
|
||||
_ui->general_doubleSpinBox_hardThr->setObjectName(Parameters::kRtabmapLoopThr().c_str());
|
||||
_ui->general_doubleSpinBox_loopRatio->setObjectName(Parameters::kRtabmapLoopRatio().c_str());
|
||||
_ui->comboBox_globalDescriptorExtractor->setObjectName(Parameters::kMemGlobalDescriptorStrategy().c_str());
|
||||
connect(_ui->comboBox_globalDescriptorExtractor, SIGNAL(currentIndexChanged(int)), this, SLOT(updateGlobalDescriptorVisibility()));
|
||||
|
||||
//Bayes
|
||||
_ui->general_doubleSpinBox_vp->setObjectName(Parameters::kBayesVirtualPlacePriorThr().c_str());
|
||||
@@ -1102,6 +1105,11 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
|
||||
_ui->checkBox_gms_withScale->setObjectName(Parameters::kGMSWithScale().c_str());
|
||||
_ui->gms_thresholdFactor->setObjectName(Parameters::kGMSThresholdFactor().c_str());
|
||||
|
||||
// PyDescriptor
|
||||
_ui->lineEdit_pydescriptor_path->setObjectName(Parameters::kPyDescriptorPath().c_str());
|
||||
connect(_ui->toolButton_pydescriptor_path, SIGNAL(clicked()), this, SLOT(changePyDescriptorPath()));
|
||||
_ui->pydescriptor_dim->setObjectName(Parameters::kPyDescriptorDim().c_str());
|
||||
|
||||
// verifyHypotheses
|
||||
_ui->groupBox_vh_epipolar2->setObjectName(Parameters::kVhEpEnabled().c_str());
|
||||
_ui->surf_spinBox_matchCountMinAccepted->setObjectName(Parameters::kVhEpMatchCountMin().c_str());
|
||||
@@ -1611,6 +1619,9 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
|
||||
this->setupTreeView();
|
||||
|
||||
_obsoletePanels = kPanelAll;
|
||||
|
||||
updateFeatureMatchingVisibility();
|
||||
updateGlobalDescriptorVisibility();
|
||||
}
|
||||
|
||||
PreferencesDialog::~PreferencesDialog() {
|
||||
@@ -5147,6 +5158,11 @@ void PreferencesDialog::updateFeatureMatchingVisibility()
|
||||
_ui->groupBox_gms->setVisible(_ui->reextract_nn->currentIndex() == 7);
|
||||
}
|
||||
|
||||
void PreferencesDialog::updateGlobalDescriptorVisibility()
|
||||
{
|
||||
_ui->groupBox_pydescriptor->setVisible(_ui->comboBox_globalDescriptorExtractor->currentIndex() == 1);
|
||||
}
|
||||
|
||||
void PreferencesDialog::updateOdometryStackedIndex(int index)
|
||||
{
|
||||
if(index == 11) // FLOAM -> LOAM
|
||||
@@ -5375,6 +5391,22 @@ void PreferencesDialog::changePyMatcherModel()
|
||||
}
|
||||
}
|
||||
|
||||
void PreferencesDialog::changePyDescriptorPath()
|
||||
{
|
||||
QString path;
|
||||
if(_ui->lineEdit_pydescriptor_path->text().isEmpty())
|
||||
{
|
||||
path = QFileDialog::getOpenFileName(this, tr("Select file"), this->getWorkingDirectory(), tr("Python wrapper (*.py)"));
|
||||
}
|
||||
else
|
||||
{
|
||||
path = QFileDialog::getOpenFileName(this, tr("Select file"), _ui->lineEdit_pydescriptor_path->text(), tr("Python wrapper (*.py)"));
|
||||
}
|
||||
if(!path.isEmpty())
|
||||
{
|
||||
_ui->lineEdit_pydescriptor_path->setText(path);
|
||||
}
|
||||
}
|
||||
void PreferencesDialog::changePyDetectorPath()
|
||||
{
|
||||
QString path;
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>12</number>
|
||||
<number>11</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page_22">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_29" stretch="0,0">
|
||||
@@ -11209,7 +11209,7 @@ see Sqlite3 doc 'PRAGMA synchronous'.</string>
|
||||
<property name="title">
|
||||
<string>Loop Closure Detection</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_22" stretch="0,0,0,1,0,0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_22" stretch="0,0,0,1,0,0,0">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
@@ -11370,6 +11370,36 @@ see Sqlite3 doc 'PRAGMA synchronous'.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="label_603">
|
||||
<property name="text">
|
||||
<string>Global descriptor extractor.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QComboBox" name="comboBox_globalDescriptorExtractor">
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContents</enum>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Disabled</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>PyDescriptor</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
@@ -11468,6 +11498,100 @@ see Sqlite3 doc 'PRAGMA synchronous'.</string>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_pydescriptor">
|
||||
<property name="title">
|
||||
<string>PyDescriptor</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_152">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_604">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>Python wrapper for python descriptor like <a href="https://github.com/uzh-rpg/netvlad_tf_open"><span style=" text-decoration: underline; color:#0000ff;">NetVLAD</span></a>. Download the interface <a href="https://github.com/introlab/rtabmap/tree/master/corelib/src/pydescriptor"><span style=" text-decoration: underline; color:#0000ff;">script</span></a> and copy it in the python folder of NetVLAD, then set its path below.</p></body></html></string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_118" columnstretch="0,0,1">
|
||||
<item row="0" column="0">
|
||||
<widget class="QToolButton" name="toolButton_pydescriptor_path">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="pydescriptor_dim">
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999999</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>4096</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_pydescriptor_path"/>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLabel" name="label_607">
|
||||
<property name="text">
|
||||
<string>[Required] Path to rtabmap python script.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="label_606">
|
||||
<property name="text">
|
||||
<string>Descriptor dimension.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_88">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user