Git Product home page Git Product logo

customvision-find-video-tags's Introduction

customvision-find-video-tags

Use Microsoft Custom Vision API to pin point frames in a video with the biggest probability for each tag.

This module will;

  1. download the video
  2. sample an image every second (configurable)
  3. check for each image what's the probability for each tag (using customvision.ai)
  4. for each tag, take the image with the highest probability
  5. delete local temporary files

Usage

let { pinTagsInVideo } = require('customvision-find-video-tags');

pinTagsInVideo(
  'https://southcentralus.api.cognitive.microsoft.com/customvision/v1.0/Prediction/52856430-0796-4d1b-a05b-b6a42dc14743/image',
  'f49c5905ca3148cfb5a146a0bsa3adc9',
  'http://location.com/urlpath/video.mp4',
  [ 'front', 'back', 'side' ],
  { every_n_seconds: 0.5 },
  (err, anchors) => {
    console.log('done');
  }
);

Using ffmpeg

If you want to use ffmpeg without installing it locally, you can use ffmpeg-ensure:

let { ensureFFMPEG } = require('ffmpeg-ensure');
let { pinTagsInVideo } = require('customvision-find-video-tags');

ensureFFMPEG().then(() => {
  pinTagsInVideo(
    'https://southcentralus.api.cognitive.microsoft.com/customvision/v1.0/Prediction/52856430-0796-4d1b-a05b-b6a42dc14743/image',
    'f49c5905ca3148cfb5a146a0bsa3adc9',
    'http://location.com/urlpath/video.mp4',
    [ 'front', 'back', 'side' ],
    { every_n_seconds: 0.5 },
    (err, anchors) => {
      console.log('done');
    }
  );
});

customvision-find-video-tags's People

Contributors

morsh avatar

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.