npm 中文文档 npm 中文文档
指南
npmjs.com (opens new window)
指南
npmjs.com (opens new window)
  • 快速入门

    • npm 是什么?
    • npm 安装和更新
    • npm 防止权限错误
    • npm package.json 文件
    • npm 安装包
    • npm 更新包
    • npm 卸载包
    • npm 创建 Node.js 模块
    • npm 发布和更新包
    • npm 使用语义化版本
    • npm 使用 Dist-tags 标记包
    • npm 包和模块的了解
  • 命令行
  • 配置 npm

Label Studio Frontend ·  


· ☀️

Website • Docs • Twitter • Join Slack Community

Label Studio is an open-source, configurable data annotation tool. ✌️

Frontend, as its name suggests, is the frontend library developed using React and mobx-state-tree, distributed as an NPM package. You can include it in your applications and provide data annotation support to your users. It can be granularly customized and extended.

Install


  1. ``` shell
  2. npm install @heartexlabs/label-studio
  3. ```

Usage


With Webpack

  1. ``` js
  2. import LabelStudio from 'label-studio';
  3. import 'label-studio/build/static/css/main.css';
  4. ```

With UNPKG.com

  1. ``` html
  2. !-- Include Label Studio stylesheet -->
  3. <link href="https://unpkg.com/label-studio@1.4.0/build/static/css/main.css" rel="stylesheet">
  4. !-- Create the Label Studio container -->
  5. <div id="label-studio"></div>
  6. !-- Include the Label Studio library -->
  7. <script src="https://unpkg.com/label-studio@1.4.0/build/static/js/main.js"></script>
  8. ```

Initialization

  1. ``` html
  2. !-- Initialize Label Studio -->
  3. <script>
  4.   var labelStudio = new LabelStudio('label-studio', {
  5.     config: `
  6.       <View>
  7.         <Image name="img" value="$image"></Image>
  8.         <RectangleLabels name="tag" toName="img">
  9.           <Label value="Hello"></Label>
  10.           <Label value="World"></Label>
  11.         </RectangleLabels>
  12.       </View>
  13.     `,
  14.     interfaces: [
  15.       "panel",
  16.       "update",
  17.       "submit",
  18.       "controls",
  19.       "side-column",
  20.       "annotations:menu",
  21.       "annotations:add-new",
  22.       "annotations:delete",
  23.       "predictions:menu",
  24.     ],
  25.     user: {
  26.       pk: 1,
  27.       firstName: "James",
  28.       lastName: "Dean"
  29.     },
  30.     task: {
  31.       annotations: [],
  32.       predictions: [],
  33.       id: 1,
  34.       data: {
  35.         image: "https://htx-misc.s3.amazonaws.com/opensource/label-studio/examples/images/nick-owuor-astro-nic-visuals-wDifg5xc9Z4-unsplash.jpg"
  36.       }
  37.     },
  38.     onLabelStudioLoad: function(LS) {
  39.       var c = LS.annotationStore.addAnnotation({
  40.         userGenerate: true
  41.       });
  42.       LS.annotationStore.selectAnnotation(c.id);
  43.     }
  44.   });
  45. </script>
  46. ```

Development


Clone the repository

  1. ``` shell
  2. git clone git@github.com:heartexlabs/label-studio-frontend.git
  3. # or: git clone https://github.com/heartexlabs/label-studio-frontend.git
  4. cd label-studio-frontend
  5. ```

Install required dependencies

  1. ``` shell
  2. npm install
  3. ```

Start the development server

  1. ``` shell
  2. npm run start
  3. ```

Check different ways to initiate the development server config & task data in src/env/development.js, changing the data variable is a good place to start.

After you make changes and ready to use it in production, you need to create a production build

  1. ``` shell
  2. npm run build-bundle
  3. ```

Now you have one .js file and one .css file in the build/static/ directory

Label Studio for Teams, Startups, and Enterprises 🏢


Label Studio for Teams is our enterprise edition (cloud & on-prem), that includes a data manager, high-quality baseline models, active learning, collaborators support, and more. Please visit the website to learn more.

Ecosystem


Project Description
:--- :---
label-studio Server part, distributed as a pip package
label-studio-frontend Frontend part, written in JavaScript and React, can be embedded into your application
label-studio-converter Encode labels into the format of your favorite machine learning library
label-studio-transformers Transformers library connected and configured for use with label studio

License


This software is licensed under the Apache 2.0 LICENSE © Heartex. 2020

undefined
Last Updated: 2023-05-15 10:22:02