noirsight
Version:
Deepfake Detection & Content Analyser Wrapper
20 lines (19 loc) • 579 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const refineConfidence = ({ label, confidence }) => {
let newLabel = label;
let newConfidence = confidence;
// Invert only for low confidence
if (label === "real" && confidence > 0.3) {
newConfidence = 1 - confidence;
}
if (newConfidence <= 0.3) {
newLabel = label === "real" ? "fake" : "real";
newConfidence = 1 - newConfidence;
}
return {
label: newLabel,
confidence: newConfidence
};
};
exports.default = refineConfidence;