GithubHelp home page GithubHelp logo

kimwoonggon / vidat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anucvml/vidat

0.0 1.0 0.0 22.4 MB

Video Annotation Tool

License: MIT License

JavaScript 23.98% Python 10.52% CSS 0.26% HTML 0.34% Vue 64.48% EJS 0.43%

vidat's Introduction

Vidat logo

Vidat

An in-browser video annotation tool developed by ANU CVML.

Stable Release Latest Release CD Status Star

ANU Host ANU Demo Aliyun Host Aliyun Demo Youtube Tutorials

The aim of this project is to develop a high-quality video annotation tool for computer vision and machine learning applications with the following desiderata:

  1. Simple and efficient to use for a non-expert.
  2. Supports multiple annotation types including temporal segments, object bounding boxes, semantic and instance regions, tracklets, and human pose (skeleton).
  3. Runs in a browser without external libraries or need for server-side processing. But easy to plug-in a back-end for heavy "in-the-loop" processing (e.g., segments from bounding boxes or frame completion from partial labels).
  4. Integrates easily with crowd-sourced annotation services (e.g., Amazon Mechanical Turk).
  5. Compatible with all (most) modern browsers and operating systems including tablets.
  6. Secure. Data does not need to leave the local machine (since there is no server-side processing).
  7. Open-source.

Screenshots

Object

Object

Region

Region

Skeleton

Skeleton

Skeleton Type

Skeleton Type

Action

Action

Usage

Annotate local videos

Just open Host and open a local video, you are good to go!

Annotate remote videos

You need to deploy Vidat first, and then use URL parameters to load the video into Vidat. Please note that Vidat does not support online YouTube videos due to Cross-Origin Resource Sharing (CORS).

Integrate with Amazon Mechanical Turk (MTurk)

  1. Prepare tasks
    1. Deploy Vidat on a server which can access to the videos and annotation (config) files.
    2. Generate URLs for each task, e.g. https://example.com?annotation=task1.json&submitURL=http%3A%2F%2Fexample2.com%3Ftoken%3D123456.
  2. Dispatch tasks on MTurk
    1. Create a new MTurk task with survey template, replace the survey link with task link.
    2. Create a batch with generated URLs.
  3. Collect submissions
    1. Build up an independent API backend (see /tools/backend/ for a simple implementation) that handles submissions.

Submission API:

Request

POST <submitURL>
content-type: application/json
<annotation>

Respond

content-type: application/json
{
    type: '' // color: "primary" (default) | "secondary" | "accent" | "dark" | "positive" | "negative" | "info" | "warning"
    message: '' // notify the user (required)
    clipboard: '' // copy to user's clipboard (optional)
}

Deployment

Note that this is only necessary if you want to do development or host your own version of the tool. If you just want to label videos then you can use one of the host servers linked to above (data will remain on your local machine; it will not be sent to the host server).

  1. Download our latest release. Note that the pre-release is automatically generated and should not be used in production.
  2. Unzip all files and put them behind a web server (Nginx, Apache, etc.). Note that open index.html in your explorer does not work.
  3. Open in your favourite browser.

URL Parameters

All the keys and values are not case-sensitive.

Note if you are using an external URL for annotation, video, config or submitURL, please make sure you are following Cross-Origin Resource Sharing (CORS). And they need to be URL encoded if there is any special characters.

annotation

Default null

Example /annotation/exmaple.json, http://exmaple/static/annotation/exmaple.json

Path to the annotation file. Vidat will load the video, annotation and configurations from this file. This parameter has higher priority than video, config, defaultFPS and defaultFPK. Please refer to File Formats - Annotation for format details.

video

Default null

Example /video/exmaple.mp4, http://exmaple/static/video/exmaple.json

Path to the video file. Please refer to decoder for more information.

config

Default null

Example /config/exmaple.json, http://exmaple/static/config/exmaple.json

Path to the video file. Please refer to File Formats - Config for format details.

mode

Default null

Example object | region | skeleton

Specify current mode for Vidat.

zoom

Default false

Example true | false

Whether toggle zoom on.

sensitivity

Default hasTouch ? 10 : 5

Example Integer >= 1

When detecting points / edges, the number of pixel(s) between you mouse and the annotation.

defaultFPS

Default 10

Example 1 <= Integer <= 60

The default frame per second used when extracting frames from the given video.

defaultFPK

Default 50

Example Integer >= 1

The default frame per keyframe used when generating keyframes.

decoder

Default auto

Example auto | v1 | v2

The video decoder used for frame extracting.

v1 uses <canvas> as a video decoder, by pause - draw - play - wait for timeupdate strategy. It is the most reliable and compatible methods for most cases. But it is slow and computational inefficient.

v2 uses WebCodecs.VideoDecoder, it takes the advantages of native video decoder built inside the browser. It is way faster than v1 but lack of support from old browsers.

auto Vidat will determine which one to use for you.

See VideoLoader Wiki for details.

showObjects

Default true

Example true | false

Whether to show object mode related components.

showRegions

Default true

Example true | false

Whether to show region mode related components.

showSkeletons

Default true

Example true | false

Whether to show skeleton mode related components.

showActions

Default true

Example true | false

Whether to show action related components.

muted

Default true

Example true | false

Whether to mute the video when playing.

grayscale

Default false

Example true | false

Whether to grayscale the video.

showPopup

Default true

Example true | false

Whether to show quick popup when finishing annotating an object/region/skeleton.

submitURL

Default null

Example submitURL=http%3A%2F%2Fexample.com%3Ftoken%3D123456

URL used for submitting annotation.

Examples

http://example.com?showObjects=false&showRegions=false&showSkeletons=false

This will show action only.

http://example.com?mode=skeleton&showPopup=false

This will set the current mode to skeleton and disable popup window.

http://example.com/index.html?submitURL=http%3A%2F%2Fexample.com%3Ftoken%3D123456

There will be a button shown in the side menu which will POST the annotation file to http://example.com?token=123456.

File Formats

Config

{
  "objectLabelData": [
    {
      "id": 0,
      "name": "default",
      "color": "<color>"
    }
  ],
  "actionLabelData": [
    {
      "id": 0,
      "name": "default",
      "color": "<color>",
      "objects": [
        0
      ]
    }
  ],
  "skeletonTypeData": [
    {
      "id": 0,
      "name": "default",
      "description": "",
      "color": "<color>",
      "pointList": [
        {
          "id": 0,
          "name": "point 1",
          "x": -10,
          "y": 0
        },
        {
          "id": 0,
          "name": "point 2",
          "x": 10,
          "y": 0
        }
      ],
      "edgeList": [
        {
          "id": 0,
          "from": 0,
          "to": 1
        }
      ]
    }
  ]
}

See public/config/example.json for am example.

Annotation

{
  "version": "2.0.0",
  "annotation": {
    "video": {
      "src": "<path to video>",
      "fps": "fps",
      "frames": 0,
      "duration": 0,
      "height": 0,
      "width": 0
    },
    "keyframeList": [
      0
    ],
    "objectAnnotationListMap": {
      "0": [
        {
          "instance": 0,
          "score": 0,
          "labelId": 0,
          "color": "<color>",
          "x": 0,
          "y": 0,
          "width": 0,
          "height": 0
        }
      ]
    },
    "regionAnnotationListMap": {
      "0": [
        {
          "instance": 0,
          "score": 0,
          "labelId": 0,
          "color": "<color>",
          "pointList": [
            {
              "x": 0,
              "y": 0
            },
            {
              "x": 0,
              "y": 0
            },
            {
              "x": 0,
              "y": 0
            }
          ]
        }
      ]
    },
    "skeletonAnnotationListMap": {
      "0": [
        {
          "instance": 0,
          "score": 0,
          "centerX": 0,
          "centerY": 0,
          "typeId": 0,
          "color": "<color>",
          "_ratio": 1,
          "pointList": [
            {
              "id": -1,
              "name": "center",
              "x": 0,
              "y": 0
            },
            {
              "id": 0,
              "name": "point 1",
              "x": -10,
              "y": 0
            },
            {
              "id": 1,
              "name": "point 2",
              "x": 10,
              "y": 0
            }
          ]
        }
      ]
    },
    "actionAnnotationList": [
      {
        "start": 0,
        "end": 0,
        "action": 0,
        "object": 0,
        "color": "<color>",
        "description": ""
      }
    ]
  },
  "config": "<config>"
}

See public/annotation/example.json for am example.

Development

See Wiki for details.

Design

See Design Wiki for details.

Citing

If you use Vidat for your research and wish to reference it, please use the following BibTex entry:

@misc{zhang2020vidat,
  author =       {Jiahao Zhang and Stephen Gould and Itzik Ben-Shabat},
  title =        {Vidat---{ANU} {CVML} Video Annotation Tool},
  howpublished = {\url{https://github.com/anucvml/vidat}},
  year =         {2020}
}

vidat's People

Contributors

davidzhang73 avatar sgould avatar

Watchers

James Cloos 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.