A modular, multi-task, multi-user annotation platform built on Gradio. Highly extensible and configurable, designed for efficient data labeling in research and production.
- Modular Design: Each annotation task is an independent module with its own UI configuration, components, and logic.
- Multi-Task Support: Run and manage multiple annotation tasks simultaneously.
- Multi-User System: User login and permission management, with data isolation per user.
- Configurable UI: Define and modify annotation interfaces via simple Python config files—no frontend coding required.
- Flexible Backend: Supports JSONL files (for debugging) and SQLite databases (for production).
Python 3.10 recommended.
pip install -r requirements.txt(Note: Please ensure requirements.txt matches your actual dependencies.)
Before using database mode, import your raw data into the target task's database.
Example for whole_annotation task:
python -m src.importers.generic_importer --task whole_annotation --file /path/to/your/data.jsonlList all available tasks:
python src/main_multi.py --list-tasksRun "Whole Object Annotation" (whole_annotation):
python src/main_multi.py --task whole_annotationThen visit http://0.0.0.0:7801 in your browser.
Run "Part Annotation" (part_annotation):
python src/main_multi.py --task part_annotation --port 7802Then visit http://0.0.0.0:7802.
Skip login and enter as developer:
python src/main_multi.py --task whole_annotation --dev --uid my_dev_user.
├── config/ # User and admin config files
├── database_jsonl/ # JSONL data files for debug mode
├── databases/ # SQLite database files
├── exports/ # Exported data
├── src/ # Core source code
│ ├── importers/ # Data import scripts
│ ├── ui_configs/ # UI config files for each task
│ ├── __init__.py
│ ├── auth_handler.py # User authentication
│ ├── component_factory.py # Gradio component factory
│ ├── db_handler.py # Database operations
│ ├── db_models.py # Database models
│ ├── field_processor.py # Field processor
│ ├── jsonl_handler.py # JSONL file operations
│ ├── main_multi.py # Main entry point
│ └── routes.py # Task routing config
└── tools/ # Utility scripts
- Create UI Config: Add a new
[your_task_name]_config.pyinsrc/ui_configs/. Refer towhole_annotation_config.pyfor structure—defineCOMPONENTS,LAYOUT_CONFIG, etc. - Add Route: In
src/routes.py, add a new route for your task, specifyingtask,port, etc. - Create Importer (Optional): If needed, add a custom data importer in
src/importers/. - Run: Start your new task with
python src/main_multi.py --task [your_task_name].
- COMPONENTS: List of Gradio components for the task UI.
- LAYOUT_CONFIG: Tree structure defining component layout.
- CUSTOM_CSS: (Optional) Custom CSS for advanced UI styling.
See src/ui_configs/whole_annotation_config.py for a full example.
This project is licensed under the Apache 2.0 License.
LabelAnything 是一个模块化、支持多任务、多用户的标注工具平台,基于 Gradio 构建,具有高度的可扩展性和可配置性。
- 模块化设计:每个标注任务都是独立模块,拥有自己的 UI 配置、组件和逻辑。
- 多任务支持:可同时运行和管理多个不同的标注任务。
- 多用户系统:支持用户登录和权限管理,数据按用户隔离。
- 可配置 UI:通过 Python 配置文件定义和修改标注界面,无需前端开发。
- 数据后端:支持 JSONL 文件(调试用)和 SQLite 数据库(生产用)。
-
安装依赖(建议 Python 3.10):
pip install -r requirements.txt
-
数据初始化:
python -m src.importers.generic_importer --task whole_annotation --file /path/to/your/data.jsonl
-
运行标注任务:
- 列出所有任务:
python src/main_multi.py --list-tasks
- 运行整体物体标注:
浏览器访问 http://0.0.0.0:7801
python src/main_multi.py --task whole_annotation
- 运行部件标注:
浏览器访问 http://0.0.0.0:7802
python src/main_multi.py --task part_annotation --port 7802
- 列出所有任务:
-
开发模式(跳过登录):
python src/main_multi.py --task whole_annotation --dev --uid my_dev_user
.
├── config/ # 用户和管理员配置
├── database_jsonl/ # Debug 用 JSONL 数据
├── databases/ # SQLite 数据库
├── exports/ # 导出数据
├── src/ # 核心代码
│ ├── importers/ # 数据导入脚本
│ ├── ui_configs/ # 各任务 UI 配置
│ ├── ...
└── tools/ # 辅助工具
- 在
src/ui_configs/下新建[your_task_name]_config.py,参考whole_annotation_config.py。 - 在
src/routes.py添加路由。 - (可选)在
src/importers/添加数据导入器。 - 运行新任务。
COMPONENTS:定义所有组件。LAYOUT_CONFIG:页面布局。CUSTOM_CSS:自定义样式(可选)。
详细示例见 src/ui_configs/whole_annotation_config.py。
如需详细说明或遇到问题,请提交 Issue。