From bd31789dc16ca53b5be191c0b274e99c2d001e6f Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Tue, 31 Aug 2021 17:54:06 -0600 Subject: [PATCH] remove imposteruniquenessmeasure --- openbr/plugins/metadata/imposteruniquenessmeasure.cpp | 94 ---------------------------------------------------------------------------------------------- 1 file changed, 0 insertions(+), 94 deletions(-) delete mode 100644 openbr/plugins/metadata/imposteruniquenessmeasure.cpp diff --git a/openbr/plugins/metadata/imposteruniquenessmeasure.cpp b/openbr/plugins/metadata/imposteruniquenessmeasure.cpp deleted file mode 100644 index dcaf7a2..0000000 --- a/openbr/plugins/metadata/imposteruniquenessmeasure.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright 2012 The MITRE Corporation * - * * - * Licensed under the Apache License, Version 2.0 (the "License"); * - * you may not use this file except in compliance with the License. * - * You may obtain a copy of the License at * - * * - * http://www.apache.org/licenses/LICENSE-2.0 * - * * - * Unless required by applicable law or agreed to in writing, software * - * distributed under the License is distributed on an "AS IS" BASIS, * - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * - * See the License for the specific language governing permissions and * - * limitations under the License. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -#include -#include - -namespace br -{ - -/*! - * \ingroup transforms - * \brief Impostor Uniqueness Measure - * \author Josh Klontz \cite jklontz - */ -class ImpostorUniquenessMeasureTransform : public Transform -{ - Q_OBJECT - Q_PROPERTY(br::Distance* distance READ get_distance WRITE set_distance RESET reset_distance STORED false) - Q_PROPERTY(double mean READ get_mean WRITE set_mean RESET reset_mean) - Q_PROPERTY(double stddev READ get_stddev WRITE set_stddev RESET reset_stddev) - Q_PROPERTY(QString inputVariable READ get_inputVariable WRITE set_inputVariable RESET reset_inputVariable STORED false) - BR_PROPERTY(br::Distance*, distance, Distance::make("Dist(L2)", this)) - BR_PROPERTY(double, mean, 0) - BR_PROPERTY(double, stddev, 1) - BR_PROPERTY(QString, inputVariable, "Label") - - TemplateList impostors; - - float calculateIUM(const Template &probe, const TemplateList &gallery) const - { - const QString probeLabel = probe.file.get(inputVariable); - TemplateList subset = gallery; - for (int j=subset.size()-1; j>=0; j--) - if (subset[j].file.get(inputVariable) == probeLabel) - subset.removeAt(j); - - QList scores = distance->compare(subset, probe); - float min, max; - Common::MinMax(scores, &min, &max); - double mean = Common::Mean(scores); - return (max-mean)/(max-min); - } - - void train(const TemplateList &data) - { - distance->train(data); - impostors = data; - - QList iums; iums.reserve(impostors.size()); - for (int i=0; istore(stream); - stream << mean << stddev << impostors; - } - - void load(QDataStream &stream) - { - distance->load(stream); - stream >> mean >> stddev >> impostors; - } -}; - -BR_REGISTER(Transform, ImpostorUniquenessMeasureTransform) - -} // namespace br - -#include "metadata/imposteruniquenessmeasure.moc" -- libgit2 0.21.4