AGENT SKILL

layout-parser

Routes LayoutParser workflows for document layout objects, document I/O, visualization, OCR, and layout-detection model wrappers.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
layout-parser
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Routes LayoutParser workflows for document layout objects, document I/O, visualization, OCR, and layout-detection model wrappers.
disable-model-invocation
true

02 资源文件 7

03 SKILL.md 正文

LayoutParser

LayoutParser is a document-image analysis toolkit for layout objects, page/token loading, OCR parsing, visualization, and layout-detection model wrappers.

Use this root skill as a router. Read the owning sub-skill for detailed API notes, workflow steps, and troubleshooting.

Install and first checks

Base install:

pip install layoutparser

OCR support:

pip install "layoutparser[ocr]"

Layout-model support:

pip install "layoutparser[layoutmodels]"
pip install "layoutparser[effdet]"
pip install "layoutparser[paddledetection]"

Detectron2 still uses its own backend install path:

pip install layoutparser torchvision
pip install "detectron2@git+https://github.com/facebookresearch/detectron2.git@v0.5#egg=detectron2"

For local inspection from a checkout, prefer an isolated environment and an editable install in that private environment rather than mutating the source repository.

Minimal import checks:

python -c "import layoutparser as lp; print(lp.__version__)"
python -c "from layoutparser import Layout, Rectangle; print(Layout([Rectangle(0, 0, 10, 10)]))"

If backend availability is uncertain, run the bundled inspector:

python scripts/inspect_backends.py

For a local smoke check that stays inside synthetic data, use:

python scripts/smoke_layoutparser_core.py

Route map

layout-objects

Read this for:

  • Interval, Rectangle, Quadrilateral, TextBlock, and Layout
  • coordinate transforms, padding, shifting, scaling, cropping
  • union, intersect, relative_to, condition_on, is_in
  • Layout sorting, filtering, serialization, and line/category grouping

layout-io

Read this for:

  • load_json, load_dict, load_csv, load_dataframe, load_pdf
  • JSON/CSV/DataFrame round-trips and PDF token extraction
  • page metadata, block_type, and layout export/import issues
  • COCO-style annotation conversion patterns

visualization

Read this for:

  • draw_box and draw_text
  • color maps, alpha handling, font settings, vertical text, and layout overlays
  • turning detected or loaded layouts into readable page visuals

layout-models

Read this for:

  • AutoLayoutModel
  • Detectron2LayoutModel, EfficientDetLayoutModel, and PaddleDetectionLayoutModel
  • lp:// config parsing, model catalogs, label maps, and backend selection
  • model download, cache, and device-selection behavior

ocr

Read this for:

  • TesseractAgent, TesseractFeatureType
  • GCVAgent, GCVFeatureType
  • OCR response parsing, saved-response loading, and text aggregation
  • credential and binary requirements for live OCR

Root references

  • Read references/api-reference.md for the top-level public API map.
  • Read references/workflows.md for cross-sub-skill document workflows.
  • Read references/repo-provenance.md before checking staleness or refreshing.
  • Read references/repo-routing-metadata.json only when verifying managed repo-skills-router placement.

When to jump to troubleshooting

Read references/troubleshooting.md when you see any of these:

  • missing optional backend imports
  • pkg_resources / setuptools issues around google-cloud-vision==1
  • tesseract or credential problems
  • pdf2image / poppler problems
  • InvalidShapeError, NotSupportedShapeError, or layout validation errors
  • model download, cache, or lp:// parsing failures

Notes for future agents

  • This skill is public runtime guidance; do not rely on the original checkout remaining available.
  • Runtime links should stay inside this generated skill tree.
  • Use the sub-skill that matches the user’s primary workflow first, then cross- reference the others when a task spans multiple layers.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351