Socket
Socket
Sign inDemoInstall

@zityspace/react-annotate

Package Overview
Dependencies
134
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @zityspace/react-annotate

React library for annotating computer vision datasets


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

react-annotate

NPM JavaScript Style Guide

React library for annotating computer vision dataset. Currently it supports annotating points, lines, boxes, segmentation masks.

Status

Still in development.

Install

For production: yarn add @ZitySpace/react-annotate, or npm install @ZitySpace/react-annotate --save. For development: yarn link @ZitySpace/react-annotate.

Simple Example
// import the component and css
import { Annotator } from '@ZitySpace/react-annotate';
import '@ZitySpace/react-annotate/dist/index.css';
...

const App = () => {
  ...
  return (
    <div className='h-screen w-screen'>
      <Annotator imagesList={imagesList} /> // use
    </div>
  );
};

For specific example, visit here

Annotator Props
  • ⚠️ imagesList: required
    • type: ImageData[]
    • description: all the image and annotation data required
  • initIndex: optional
    • type: number
    • description: first image's index
  • onSave: optional
    • type: (curImageData: ImageData, curIndex: number, imagesList: ImageData[]) => void
    • description: will be invoked when the save button was clicked
  • onSwitch: optional
    • type: (curImageData: ImageData, curIndex: number, imagesList: ImageData[], type: "prev" | "next") => void
    • description: will be invoked when the prev/next button was clicked

Development in the repo

  1. run yarn install under root path to install dependencies.
  2. run yarn dev to watch and hot build the library.
  3. run yarn install and yarn start under example folder to hot build the example.
  4. edit library source code and see changes in the example UI.

Documentation

Keyboard shortcuts

  • Backspace / Delete: delete the selected annotation

  • R: toggle drawing mode to Rectangle

  • O: toggle drawing mode to Point

  • L: toggle drawing mode to Line

  • P: toggle drawing mode to Polygon

  • V: toggle annotations' visibility

  • < / : switch to previous image

  • > / : switch to next image

  • Ctrl+R / Cmd+R: toggle annotation alter history between current and origin state

  • Ctrl+Z / Cmd+Z: undo last annotation alter

  • Ctrl+Shift+Z / Cmd+Shift+Z: redo last annotation alter

  • Ctrl+S / Cmd+S: save annotations

Reference

License

Apache 2.0 © ZitySpace

FAQs

Last updated on 14 Nov 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc