From e0b0b2f976c61225a178c7715caf2656a1f6741f Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 15 Dec 2018 21:32:51 +0100 Subject: moving stuff --- scraper/client/common/classifier.component.js | 99 --------------------------- 1 file changed, 99 deletions(-) delete mode 100644 scraper/client/common/classifier.component.js (limited to 'scraper/client/common/classifier.component.js') diff --git a/scraper/client/common/classifier.component.js b/scraper/client/common/classifier.component.js deleted file mode 100644 index af6a4934..00000000 --- a/scraper/client/common/classifier.component.js +++ /dev/null @@ -1,99 +0,0 @@ -import React, { Component } from 'react' -import { courtesyS } from '../util' - -import { TableTuples, DetectionList, Keyframe } from '.' - -export default class Classifier extends Component { - render() { - const { - tag, - sha256, - verified, - keyframes = {}, - labels, - summary, - aspectRatio = 1.777, - showAll, - } = this.props - let totalDetections = 0 - const keys = Object - .keys(keyframes) - .map(s => parseInt(s, 10)) - const validKeyframes = keys - .sort((a, b) => a - b) - .map(frame => { - const detections = keyframes[frame] - if (detections.length || showAll) { - totalDetections += detections.length - return { frame, detections } - } - return null - }) - .filter(f => !!f) - const detectionLookup = validKeyframes - .reduce((a, b) => { - b.detections.reduce((aa, { idx }) => { - if (!(idx in aa)) aa[idx] = [labels[idx], 0] - aa[idx][1] += 1 - return aa - }, a) - return a - }, {}) - const detectionCounts = Object.keys(detectionLookup) - .map(idx => detectionLookup[idx]) - .sort((a, b) => b[1] - a[1]) - - if (summary) { - return ( -
-

{tag}{' Detections'}

- -
- ) - } - return ( -
-

{tag}

-

Detections

- -

Frames

-
    -
  • - {'Displaying '}{validKeyframes.length}{' / '}{courtesyS(keys.length, 'frame')} -
  • -
  • - {courtesyS(totalDetections, 'detection')}{' found'} -
  • -
-
- {validKeyframes.map(({ frame, detections }) => ( - - - - ))} -
-
- ) - } -} -- cgit v1.2.3-70-g09d2