mirror of
https://github.com/dgirardeau/q3DMASC.git
synced 2026-08-29 08:34:48 +08:00
version 1.0
This commit is contained in:
+1
-1
@@ -8,7 +8,7 @@ if (PLUGIN_STANDARD_3DMASC)
|
||||
project( Q3DMASC_PLUGIN )
|
||||
|
||||
AddPlugin( NAME ${PROJECT_NAME} )
|
||||
set(Q3DMASC_PLUGIN_VERSION "0.12+")
|
||||
set(Q3DMASC_PLUGIN_VERSION "1.0")
|
||||
|
||||
include( CMakePolicies NO_POLICY_SCOPE )
|
||||
|
||||
|
||||
+1
-6
@@ -32,8 +32,7 @@ QColor getColor(double value, double r1, double g1, double b1)
|
||||
return QColor(r, g, b);
|
||||
}
|
||||
|
||||
ConfusionMatrix::ConfusionMatrix(const std::vector<ScalarType> &actual, const std::vector<ScalarType> &predicted, QWidget *parent, ccMainAppInterface *app) :
|
||||
QWidget(parent),
|
||||
ConfusionMatrix::ConfusionMatrix(const std::vector<ScalarType> &actual, const std::vector<ScalarType> &predicted) :
|
||||
ui(new Ui::ConfusionMatrix)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
@@ -41,10 +40,6 @@ ConfusionMatrix::ConfusionMatrix(const std::vector<ScalarType> &actual, const st
|
||||
|
||||
compute(actual, predicted);
|
||||
|
||||
if (app)
|
||||
{
|
||||
this->show();
|
||||
}
|
||||
this->ui->tableWidget->resizeColumnsToContents();
|
||||
this->ui->tableWidget->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
|
||||
QSize tableSize = this->ui->tableWidget->sizeHint();
|
||||
|
||||
+2
-4
@@ -25,10 +25,8 @@ public:
|
||||
F1_SCORE = 2
|
||||
};
|
||||
|
||||
explicit ConfusionMatrix( const std::vector<ScalarType>& actual,
|
||||
const std::vector<ScalarType>& predicted,
|
||||
QWidget *parent = nullptr,
|
||||
ccMainAppInterface* app = nullptr);
|
||||
explicit ConfusionMatrix(const std::vector<ScalarType>& actual,
|
||||
const std::vector<ScalarType>& predicted);
|
||||
~ConfusionMatrix() override;
|
||||
|
||||
void computePrecisionRecallF1Score(cv::Mat& matrix, cv::Mat& precisionRecallF1Score, cv::Mat &vec_TP_FN);
|
||||
|
||||
@@ -425,7 +425,6 @@ void q3DMASCPlugin::doTrainAction()
|
||||
//compute the core points (if necessary)
|
||||
ccProgressDialog progressDlg(true, m_app->getMainWindow());
|
||||
progressDlg.setAutoClose(false);
|
||||
ccLog::Error("Qt::WA_DeleteOnClose " + QString::number(progressDlg.testAttribute(Qt::WA_DeleteOnClose)));
|
||||
if (!corePoints.prepare(&progressDlg))
|
||||
{
|
||||
m_app->dispToConsole("Failed to compute/prepare the core points!", ccMainAppInterface::ERR_CONSOLE_MESSAGE);
|
||||
|
||||
@@ -481,7 +481,12 @@ bool Classifier::evaluate(const Feature::Source::Set& featureSources,
|
||||
metrics.ratio = static_cast<float>(metrics.goodGuess) / metrics.sampleCount;
|
||||
}
|
||||
|
||||
train3DMASCDialog.addConfusionMatrixAndSaveTraces(new ConfusionMatrix(actualClass, predictectedClass, nullptr, app));
|
||||
ConfusionMatrix* confusionMatrix = new ConfusionMatrix(actualClass, predictectedClass);
|
||||
train3DMASCDialog.addConfusionMatrixAndSaveTraces(confusionMatrix);
|
||||
if (app)
|
||||
{
|
||||
confusionMatrix->show();
|
||||
}
|
||||
|
||||
//show the Classification_prediction field by default
|
||||
if (outSF)
|
||||
|
||||
@@ -1231,7 +1231,6 @@ bool Tools::PrepareFeatures(const CorePoints& corePoints, Feature::Set& features
|
||||
ccLog::Print(logMessage);
|
||||
CCCoreLib::NormalizedProgress nProgress(progressCb, pointCount);
|
||||
|
||||
QMutex mutex;
|
||||
bool cancelled = false;
|
||||
|
||||
#ifndef _DEBUG
|
||||
@@ -1386,15 +1385,12 @@ bool Tools::PrepareFeatures(const CorePoints& corePoints, Feature::Set& features
|
||||
|
||||
if (!localSuccess)
|
||||
{
|
||||
mutex.lock();
|
||||
cancelled = true;
|
||||
success = false;
|
||||
errorStr = "Feature computation failed for point " + QString::number(i) + " (using OpenMP with " + QString::number(omp_get_num_threads()) + " threads)";
|
||||
ccLog::Error(localErrorStr);
|
||||
mutex.unlock();
|
||||
}
|
||||
|
||||
mutex.lock();
|
||||
if (progressCb)
|
||||
{
|
||||
if (!cancelled)
|
||||
@@ -1405,12 +1401,10 @@ bool Tools::PrepareFeatures(const CorePoints& corePoints, Feature::Set& features
|
||||
//process cancelled by the user
|
||||
errorStr = "Process cancelled at point " + QString::number(i) + " (using OpenMP with " + QString::number(omp_get_num_threads()) + " threads)";
|
||||
ccLog::Warning(errorStr);
|
||||
ccLog::Error(localErrorStr);
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
mutex.unlock();
|
||||
}
|
||||
} //for each point
|
||||
|
||||
|
||||
Reference in New Issue
Block a user