From 6ee3b6932edea86b91f621b8056515462bdb554f Mon Sep 17 00:00:00 2001 From: robfrks Date: Tue, 16 Jul 2024 15:34:09 +0200 Subject: [PATCH] removed commented code and unused imports --- .../Deepfake/Results/DeepfakeResultsImage.jsx | 8 +- .../Deepfake/Results/DeepfakeResultsVideo.jsx | 3 - .../syntheticImageDetectionResults.jsx | 245 +----------------- .../GaugeChartResults/GaugeChartResult.jsx | 13 - 4 files changed, 2 insertions(+), 267 deletions(-) diff --git a/src/components/NavItems/tools/Deepfake/Results/DeepfakeResultsImage.jsx b/src/components/NavItems/tools/Deepfake/Results/DeepfakeResultsImage.jsx index 612b4d0b7..dec1866dc 100644 --- a/src/components/NavItems/tools/Deepfake/Results/DeepfakeResultsImage.jsx +++ b/src/components/NavItems/tools/Deepfake/Results/DeepfakeResultsImage.jsx @@ -14,16 +14,10 @@ import { AccordionDetails, } from "@mui/material"; import { i18nLoadNamespace } from "components/Shared/Languages/i18nLoadNamespace"; -import { LinearProgressWithLabel } from "../../../../Shared/LinearProgressWithLabel/LinearProgressWithLabel"; -import { Close, Download, ExpandMore, Help } from "@mui/icons-material"; +import { Close } from "@mui/icons-material"; import { useSelector } from "react-redux"; -import { DetectionProgressBar } from "components/Shared/DetectionProgressBar/DetectionProgressBar"; import { getclientId } from "components/Shared/GoogleAnalytics/MatomoAnalytics"; import { useTrackEvent } from "Hooks/useAnalytics"; -import GaugeChart from "react-gauge-chart"; -import GaugeChartModalExplanation from "components/Shared/GaugeChartResults/GaugeChartModalExplanation"; -import { exportReactElementAsJpg } from "components/Shared/Utils/htmlUtils"; -import CustomAlertScore from "components/Shared/CustomAlertScore"; import GaugeChartResult from "components/Shared/GaugeChartResults/GaugeChartResult"; const DeepfakeResultsImage = (props) => { diff --git a/src/components/NavItems/tools/Deepfake/Results/DeepfakeResultsVideo.jsx b/src/components/NavItems/tools/Deepfake/Results/DeepfakeResultsVideo.jsx index fe063052c..a02c2ca52 100644 --- a/src/components/NavItems/tools/Deepfake/Results/DeepfakeResultsVideo.jsx +++ b/src/components/NavItems/tools/Deepfake/Results/DeepfakeResultsVideo.jsx @@ -13,9 +13,6 @@ import { } from "@mui/material"; import { i18nLoadNamespace } from "components/Shared/Languages/i18nLoadNamespace"; import CloseIcon from "@mui/icons-material/Close"; -import Help from "@mui/icons-material/Help"; -import { LinearProgressWithLabel } from "../../../../Shared/LinearProgressWithLabel/LinearProgressWithLabel"; -import { DetectionProgressBar } from "components/Shared/DetectionProgressBar/DetectionProgressBar"; import { getclientId } from "components/Shared/GoogleAnalytics/MatomoAnalytics"; import { useSelector } from "react-redux"; import { useTrackEvent } from "Hooks/useAnalytics"; diff --git a/src/components/NavItems/tools/SyntheticImageDetection/syntheticImageDetectionResults.jsx b/src/components/NavItems/tools/SyntheticImageDetection/syntheticImageDetectionResults.jsx index 607d24d53..9913a59fb 100644 --- a/src/components/NavItems/tools/SyntheticImageDetection/syntheticImageDetectionResults.jsx +++ b/src/components/NavItems/tools/SyntheticImageDetection/syntheticImageDetectionResults.jsx @@ -1,29 +1,18 @@ import React, { useEffect, useRef, useState } from "react"; import { - Accordion, - AccordionDetails, - AccordionSummary, Alert, Box, Card, CardHeader, - Chip, - Divider, Grid, IconButton, Stack, - Typography, } from "@mui/material"; -import { Close, Download, ExpandMore } from "@mui/icons-material"; +import { Close } from "@mui/icons-material"; import { i18nLoadNamespace } from "components/Shared/Languages/i18nLoadNamespace"; import { useSelector } from "react-redux"; import { useTrackEvent } from "Hooks/useAnalytics"; import { getclientId } from "components/Shared/GoogleAnalytics/MatomoAnalytics"; -import CustomAlertScore from "../../../Shared/CustomAlertScore"; -import GaugeChart from "react-gauge-chart"; -import Tooltip from "@mui/material/Tooltip"; -import { exportReactElementAsJpg } from "../../../Shared/Utils/htmlUtils"; -import GaugeChartModalExplanation from "../../../Shared/GaugeChartResults/GaugeChartModalExplanation"; import GaugeChartResult from "components/Shared/GaugeChartResults/GaugeChartResult"; const SyntheticImageDetectionResults = (props) => { @@ -313,238 +302,6 @@ const SyntheticImageDetectionResults = (props) => { {syntheticImageScores.length > 0 ? ( - /* - - - - {maxScore > DETECTION_THRESHOLDS.THRESHOLD_2 && ( - - {keyword( - "synthetic_image_detection_generic_detection_text", - )} - - )} - - - - - - {keyword( - "synthetic_image_detection_gauge_no_detection", - )} - - - {keyword("synthetic_image_detection_gauge_detection")} - - - - - - - - await exportReactElementAsJpg( - gaugeChartRef, - "gauge_chart", - ) - } - > - - - - - - - - - - {resultsHaveErrors && ( - - {keyword("synthetic_image_detection_algorithms_errors")} - - )} - - - }> - {keyword(detailsPanelMessage)} - - - - {syntheticImageScores.map((item, key) => { - let predictionScore; - - if (item.predictionScore) { - predictionScore = sanitizeDetectionPercentage( - item.predictionScore, - ); - } - - return ( - - - - - - { - DeepfakeImageDetectionMethodNames[ - item.methodName - ].name - } - - - - {item.isError ? ( - - {keyword( - "synthetic_image_detection_error_generic", - )} - - ) : ( - <> - - {keyword( - "synthetic_image_detection_probability_text", - )}{" "} - - - {predictionScore}% - - - )} - - {!item.isError && ( - - )} - - - - // removed troublesome comment - - - - - - { - DeepfakeImageDetectionMethodNames[ - item.methodName - ].description - } - - - - {syntheticImageScores.length > key + 1 && ( - - )} - - ); - })} - - - - - */ - - {/**/} - {/* {keyword(*/} - {/* "synthetic_image_detection_model_card",*/} - {/* )}*/} - {/**/} -