Git Product home page Git Product logo

Comments (5)

GantMan avatar GantMan commented on May 16, 2024

Presenting the gif classification can look like this: https://observablehq.com/d/c70415332a1f4cb9

Gif output can be converted to a readabe chart format with the following transform

let results = {name: "results", children: []}
data.map((frame, i) => {
  const lastChild = results.children.slice(-1)[0]
  const currentClass = frame[0].className
  if (lastChild && currentClass == lastChild.name) {
    // Add frame to entry
    lastChild.children.push(
      {"name": "frame " + (i+1), "value": 1}
    )
  } else {
    // Create new
    results.children.push({
      name: currentClass,
      children: [
        {"name": "frame " + (i+1), "value": 1}
      ]
    })
  }
})

This comes out looking like so!
image

from nsfwjs.

GantMan avatar GantMan commented on May 16, 2024

So getting d3 working in React is a pain.

Even though I have all the code for d3, I apparently can't get my branch to render the SVG. I might abandon the demo of classifyGif and just document it.

from nsfwjs.

GantMan avatar GantMan commented on May 16, 2024

The branch is gifGraph if someone wants to take a stab:
https://github.com/infinitered/nsfwjs/tree/gifGraph

from nsfwjs.

GantMan avatar GantMan commented on May 16, 2024

Thinking of switching to bar graph.

from nsfwjs.

GantMan avatar GantMan commented on May 16, 2024

GIF is in demo now. No graphs yet.

from nsfwjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.