chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,230 @@
|
||||
pipeline_name: PP-StructureV3
|
||||
|
||||
batch_size: 8
|
||||
|
||||
use_doc_preprocessor: True
|
||||
use_seal_recognition: True
|
||||
use_table_recognition: True
|
||||
use_formula_recognition: True
|
||||
use_chart_recognition: True
|
||||
use_region_detection: True
|
||||
|
||||
|
||||
SubModules:
|
||||
LayoutDetection:
|
||||
module_name: layout_detection
|
||||
model_name: PP-DocLayout_plus-L
|
||||
model_dir: null
|
||||
batch_size: 8
|
||||
threshold:
|
||||
0: 0.3 # paragraph_title
|
||||
1: 0.5 # image
|
||||
2: 0.4 # text
|
||||
3: 0.5 # number
|
||||
4: 0.5 # abstract
|
||||
5: 0.5 # content
|
||||
6: 0.5 # figure_table_chart_title
|
||||
7: 0.3 # formula
|
||||
8: 0.5 # table
|
||||
9: 0.5 # reference
|
||||
10: 0.5 # doc_title
|
||||
11: 0.5 # footnote
|
||||
12: 0.5 # header
|
||||
13: 0.5 # algorithm
|
||||
14: 0.5 # footer
|
||||
15: 0.45 # seal
|
||||
16: 0.5 # chart
|
||||
17: 0.5 # formula_number
|
||||
18: 0.5 # aside_text
|
||||
19: 0.5 # reference_content
|
||||
layout_nms: True
|
||||
layout_unclip_ratio: [1.0, 1.0]
|
||||
layout_merge_bboxes_mode:
|
||||
0: "large" # paragraph_title
|
||||
1: "large" # image
|
||||
2: "union" # text
|
||||
3: "union" # number
|
||||
4: "union" # abstract
|
||||
5: "union" # content
|
||||
6: "union" # figure_table_chart_title
|
||||
7: "large" # formula
|
||||
8: "union" # table
|
||||
9: "union" # reference
|
||||
10: "union" # doc_title
|
||||
11: "union" # footnote
|
||||
12: "union" # header
|
||||
13: "union" # algorithm
|
||||
14: "union" # footer
|
||||
15: "union" # seal
|
||||
16: "large" # chart
|
||||
17: "union" # formula_number
|
||||
18: "union" # aside_text
|
||||
19: "union" # reference_content
|
||||
ChartRecognition:
|
||||
module_name: chart_recognition
|
||||
model_name: PP-Chart2Table
|
||||
model_dir: null
|
||||
batch_size: 1
|
||||
RegionDetection:
|
||||
module_name: layout_detection
|
||||
model_name: PP-DocBlockLayout
|
||||
model_dir: null
|
||||
layout_nms: True
|
||||
layout_merge_bboxes_mode: "small"
|
||||
|
||||
SubPipelines:
|
||||
DocPreprocessor:
|
||||
pipeline_name: doc_preprocessor
|
||||
batch_size: 8
|
||||
use_doc_orientation_classify: True
|
||||
use_doc_unwarping: True
|
||||
SubModules:
|
||||
DocOrientationClassify:
|
||||
module_name: doc_text_orientation
|
||||
model_name: PP-LCNet_x1_0_doc_ori
|
||||
model_dir: null
|
||||
batch_size: 8
|
||||
DocUnwarping:
|
||||
module_name: image_unwarping
|
||||
model_name: UVDoc
|
||||
model_dir: null
|
||||
|
||||
GeneralOCR:
|
||||
pipeline_name: OCR
|
||||
batch_size: 8
|
||||
text_type: general
|
||||
use_doc_preprocessor: False
|
||||
use_textline_orientation: True
|
||||
SubModules:
|
||||
TextDetection:
|
||||
module_name: text_detection
|
||||
model_name: PP-OCRv5_server_det
|
||||
model_dir: null
|
||||
limit_side_len: 736
|
||||
limit_type: min
|
||||
max_side_limit: 4000
|
||||
thresh: 0.3
|
||||
box_thresh: 0.6
|
||||
unclip_ratio: 1.5
|
||||
TextLineOrientation:
|
||||
module_name: textline_orientation
|
||||
model_name: PP-LCNet_x1_0_textline_ori
|
||||
model_dir: null
|
||||
batch_size: 8
|
||||
TextRecognition:
|
||||
module_name: text_recognition
|
||||
model_name: PP-OCRv5_server_rec
|
||||
model_dir: null
|
||||
batch_size: 8
|
||||
score_thresh: 0.0
|
||||
|
||||
|
||||
TableRecognition:
|
||||
pipeline_name: table_recognition_v2
|
||||
use_layout_detection: False
|
||||
use_doc_preprocessor: False
|
||||
use_ocr_model: False
|
||||
SubModules:
|
||||
TableClassification:
|
||||
module_name: table_classification
|
||||
model_name: PP-LCNet_x1_0_table_cls
|
||||
model_dir: null
|
||||
|
||||
WiredTableStructureRecognition:
|
||||
module_name: table_structure_recognition
|
||||
model_name: SLANeXt_wired
|
||||
model_dir: null
|
||||
|
||||
WirelessTableStructureRecognition:
|
||||
module_name: table_structure_recognition
|
||||
model_name: SLANet_plus
|
||||
model_dir: null
|
||||
|
||||
WiredTableCellsDetection:
|
||||
module_name: table_cells_detection
|
||||
model_name: RT-DETR-L_wired_table_cell_det
|
||||
model_dir: null
|
||||
|
||||
WirelessTableCellsDetection:
|
||||
module_name: table_cells_detection
|
||||
model_name: RT-DETR-L_wireless_table_cell_det
|
||||
model_dir: null
|
||||
|
||||
TableOrientationClassify:
|
||||
module_name: doc_text_orientation
|
||||
model_name: PP-LCNet_x1_0_doc_ori
|
||||
model_dir: null
|
||||
SubPipelines:
|
||||
GeneralOCR:
|
||||
pipeline_name: OCR
|
||||
text_type: general
|
||||
use_doc_preprocessor: False
|
||||
use_textline_orientation: True
|
||||
SubModules:
|
||||
TextDetection:
|
||||
module_name: text_detection
|
||||
model_name: PP-OCRv5_server_det
|
||||
model_dir: null
|
||||
limit_side_len: 736
|
||||
limit_type: min
|
||||
max_side_limit: 4000
|
||||
thresh: 0.3
|
||||
box_thresh: 0.4
|
||||
unclip_ratio: 1.5
|
||||
TextLineOrientation:
|
||||
module_name: textline_orientation
|
||||
model_name: PP-LCNet_x1_0_textline_ori
|
||||
model_dir: null
|
||||
batch_size: 8
|
||||
TextRecognition:
|
||||
module_name: text_recognition
|
||||
model_name: PP-OCRv5_server_rec
|
||||
model_dir: null
|
||||
batch_size: 8
|
||||
score_thresh: 0.0
|
||||
|
||||
SealRecognition:
|
||||
pipeline_name: seal_recognition
|
||||
batch_size: 8
|
||||
use_layout_detection: False
|
||||
use_doc_preprocessor: False
|
||||
SubPipelines:
|
||||
SealOCR:
|
||||
pipeline_name: OCR
|
||||
batch_size: 8
|
||||
text_type: seal
|
||||
use_doc_preprocessor: False
|
||||
use_textline_orientation: False
|
||||
SubModules:
|
||||
TextDetection:
|
||||
module_name: seal_text_detection
|
||||
model_name: PP-OCRv4_server_seal_det
|
||||
model_dir: null
|
||||
limit_side_len: 736
|
||||
limit_type: min
|
||||
max_side_limit: 4000
|
||||
thresh: 0.2
|
||||
box_thresh: 0.6
|
||||
unclip_ratio: 0.5
|
||||
TextRecognition:
|
||||
module_name: text_recognition
|
||||
model_name: PP-OCRv5_server_rec
|
||||
model_dir: null
|
||||
batch_size: 8
|
||||
score_thresh: 0
|
||||
|
||||
FormulaRecognition:
|
||||
pipeline_name: formula_recognition
|
||||
batch_size: 8
|
||||
use_layout_detection: False
|
||||
use_doc_preprocessor: False
|
||||
SubModules:
|
||||
FormulaRecognition:
|
||||
module_name: formula_recognition
|
||||
model_name: PP-FormulaNet_plus-L
|
||||
model_dir: null
|
||||
batch_size: 8
|
||||
|
||||
Serving:
|
||||
extra:
|
||||
max_num_input_imgs: null
|
||||
@@ -0,0 +1,58 @@
|
||||
# 使用轻量级Python基础镜像
|
||||
FROM python:3.13-slim
|
||||
COPY --from=ghcr.io/astral-sh/uv:0.11.26 /uv /uvx /bin/
|
||||
COPY --from=node:24-slim /usr/local/bin /usr/local/bin
|
||||
COPY --from=node:24-slim /usr/local/lib/node_modules /usr/local/lib/node_modules
|
||||
COPY --from=node:24-slim /usr/local/include /usr/local/include
|
||||
COPY --from=node:24-slim /usr/local/share /usr/local/share
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 环境变量设置
|
||||
ENV TZ=Asia/Shanghai \
|
||||
UV_PROJECT_ENVIRONMENT="/usr/local" \
|
||||
UV_COMPILE_BYTECODE=1 \
|
||||
DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# 设置 npm 镜像源,为 MCP 和 Skills 安装依赖
|
||||
RUN npm config set registry https://registry.npmmirror.com --global \
|
||||
&& npm cache clean --force
|
||||
|
||||
# 设置代理和时区,更换镜像源,安装系统依赖 - 合并为一个RUN减少层数
|
||||
RUN set -ex \
|
||||
# (A) 设置时区
|
||||
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
|
||||
# (B) 替换清华源 (针对 Debian Bookworm 的新版格式)
|
||||
&& sed -i 's|deb.debian.org|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/debian.sources \
|
||||
&& sed -i 's|security.debian.org/debian-security|mirrors.tuna.tsinghua.edu.cn/debian-security|g' /etc/apt/sources.list.d/debian.sources \
|
||||
# (C) 安装必要的系统库
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends --fix-missing \
|
||||
curl \
|
||||
ffmpeg \
|
||||
fonts-liberation \
|
||||
fonts-noto-cjk \
|
||||
git \
|
||||
libpq5 \
|
||||
libsm6 \
|
||||
libxext6 \
|
||||
libreoffice-impress-nogui \
|
||||
libreoffice-writer-nogui \
|
||||
# (D) 清理垃圾,减小体积
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 复制项目配置文件
|
||||
COPY backend/pyproject.toml /app/pyproject.toml
|
||||
COPY backend/.python-version /app/.python-version
|
||||
COPY backend/uv.lock /app/uv.lock
|
||||
|
||||
# 先复制 package 目录,因为 pyproject.toml 中 yuxi = { path = "package", editable = true }
|
||||
COPY backend/package /app/package
|
||||
|
||||
# 如果网络还是不好,可以在后面添加 --index-url https://pypi.tuna.tsinghua.edu.cn/simple
|
||||
RUN uv sync --no-cache --group test --no-dev --frozen
|
||||
|
||||
# 复制 server 代码
|
||||
COPY backend/server /app/server
|
||||
@@ -0,0 +1,26 @@
|
||||
# https://gcore.jsdelivr.net/gh/opendatalab/MinerU@master/docker/china/Dockerfile
|
||||
# Use DaoCloud mirrored vllm image for China region for gpu with Volta、Turing、Ampere、Ada Lovelace、Hopper、Blackwell architecture (7.0 <= Compute Capability <= 12.0)
|
||||
# Compute Capability version query (https://developer.nvidia.com/cuda-gpus)
|
||||
# support x86_64 architecture and ARM(AArch64) architecture
|
||||
FROM docker.m.daocloud.io/vllm/vllm-openai:v0.11.2
|
||||
|
||||
# Install libgl for opencv support & Noto fonts for Chinese characters
|
||||
RUN apt-get update && \
|
||||
apt-get install -y \
|
||||
fonts-noto-core \
|
||||
fonts-noto-cjk \
|
||||
fontconfig \
|
||||
libgl1 && \
|
||||
fc-cache -fv && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install mineru latest
|
||||
RUN python3 -m pip install -U 'mineru[core]>=3.0.0' -i https://mirrors.aliyun.com/pypi/simple --break-system-packages && \
|
||||
python3 -m pip cache purge
|
||||
|
||||
# Download models and update the configuration file
|
||||
RUN /bin/bash -c "mineru-models-download -s modelscope -m all"
|
||||
|
||||
# Set the entry point to activate the virtual environment and run the command line tool
|
||||
ENTRYPOINT ["/bin/bash", "-c", "export MINERU_MODEL_SOURCE=local && exec \"$@\"", "--"]
|
||||
@@ -0,0 +1,32 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
# 增加客户端请求体大小限制
|
||||
client_max_body_size 20M;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
try_files $uri /index.html;
|
||||
}
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://api:5050/api/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Connection '';
|
||||
proxy_http_version 1.1;
|
||||
|
||||
# SSE/流式响应支持
|
||||
proxy_buffering off;
|
||||
proxy_cache off;
|
||||
chunked_transfer_encoding on;
|
||||
|
||||
# 增加超时时间(上传和流式响应)
|
||||
proxy_read_timeout 600;
|
||||
proxy_connect_timeout 600;
|
||||
proxy_send_timeout 600;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
user nginx;
|
||||
worker_processes auto;
|
||||
|
||||
error_log /var/log/nginx/error.log notice;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
FROM ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlex/paddlex:paddlex3.0.1-paddlepaddle3.0.0-gpu-cuda11.8-cudnn8.9-trt8.6
|
||||
|
||||
WORKDIR /root/PaddleX/paddlex
|
||||
|
||||
# 安装 hpi-cpu,如您所指示
|
||||
RUN paddlex --install hpi-cpu
|
||||
RUN paddlex --install serving
|
||||
|
||||
COPY docker/PP-StructureV3.yaml /root/PaddleX/paddlex/PP-StructureV3.yaml
|
||||
|
||||
# 暴露 PaddleX 服务端口
|
||||
EXPOSE 8080
|
||||
|
||||
# 运行 PaddleX PP-StructureV3 流水线服务
|
||||
CMD ["paddlex", "--serve", "--pipeline", "PP-StructureV3.yaml", "--host", "0.0.0.0", "--port", "8080"]
|
||||
@@ -0,0 +1,15 @@
|
||||
FROM python:3.13-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1
|
||||
|
||||
COPY requirements.txt /app/requirements.txt
|
||||
RUN pip install --no-cache-dir -r /app/requirements.txt --index https://pypi.tuna.tsinghua.edu.cn/simple
|
||||
|
||||
COPY app.py /app/app.py
|
||||
|
||||
EXPOSE 8002
|
||||
|
||||
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8002"]
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,6 @@
|
||||
fastapi>=0.121
|
||||
uvicorn[standard]>=0.34.2
|
||||
kubernetes>=31.0.0
|
||||
docker>=7.1.0
|
||||
python-dotenv>=1.0.0
|
||||
websockets>=12,<16
|
||||
@@ -0,0 +1 @@
|
||||
CHECK_YUXI_SANDBOX_ENV_EXISTS=True
|
||||
@@ -0,0 +1,54 @@
|
||||
# PowerShell脚本,用于在Windows系统上打包Docker镜像
|
||||
|
||||
# 创建输出目录
|
||||
$OutputDir = "docker_images_backup"
|
||||
if (!(Test-Path $OutputDir)) {
|
||||
New-Item -ItemType Directory -Path $OutputDir | Out-Null
|
||||
}
|
||||
|
||||
# 定义输出文件名
|
||||
$DateTime = Get-Date -Format "yyyyMMdd"
|
||||
$OutputFile = "$OutputDir\docker_images_$DateTime.tar"
|
||||
|
||||
Write-Host "开始导出Docker镜像到 $OutputFile..." -ForegroundColor Cyan
|
||||
|
||||
# 从各个文件中提取的基础镜像列表
|
||||
$Images = @(
|
||||
"python:3.11-slim",
|
||||
"ghcr.io/astral-sh/uv:0.11.26",
|
||||
"node:24-alpine",
|
||||
"node:24-slim",
|
||||
"nginx:alpine",
|
||||
"neo4j:5.26",
|
||||
"quay.io/coreos/etcd:v3.5.5",
|
||||
"minio/minio:RELEASE.2023-03-20T20-16-18Z",
|
||||
"milvusdb/milvus:v2.5.6",
|
||||
# "lmsysorg/sglang:v0.4.9.post3-cu126",
|
||||
# "ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlex/paddlex:paddlex3.0.1-paddlepaddle3.0.0-gpu-cuda11.8-cudnn8.9-trt8.6"
|
||||
)
|
||||
|
||||
# 确保所有镜像都已下载
|
||||
foreach ($Image in $Images) {
|
||||
Write-Host "正在拉取镜像: $Image" -ForegroundColor Yellow
|
||||
docker pull $Image
|
||||
}
|
||||
|
||||
# 保存所有镜像到单个tar文件
|
||||
Write-Host "正在保存镜像到tar文件..." -ForegroundColor Yellow
|
||||
docker save $Images -o $OutputFile
|
||||
|
||||
# 计算文件大小
|
||||
$FileInfo = Get-Item $OutputFile
|
||||
$FileSizeMB = [math]::Round($FileInfo.Length / 1MB, 2)
|
||||
$FileSizeGB = [math]::Round($FileInfo.Length / 1GB, 2)
|
||||
|
||||
Write-Host "完成!" -ForegroundColor Green
|
||||
Write-Host "所有Docker镜像已保存到: $OutputFile" -ForegroundColor Green
|
||||
if ($FileSizeGB -ge 1) {
|
||||
Write-Host "文件大小: $FileSizeGB GB" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "文件大小: $FileSizeMB MB" -ForegroundColor Green
|
||||
}
|
||||
|
||||
Write-Host "`n要在另一台机器上加载这些镜像,请使用命令:" -ForegroundColor Cyan
|
||||
Write-Host "docker load -i $OutputFile" -ForegroundColor White
|
||||
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 创建输出目录
|
||||
OUTPUT_DIR="docker_images_backup"
|
||||
mkdir -p $OUTPUT_DIR
|
||||
|
||||
# 定义输出文件名
|
||||
OUTPUT_FILE="$OUTPUT_DIR/docker_images_$(date +%Y%m%d).tar"
|
||||
|
||||
echo "开始导出 Docker 镜像到 $OUTPUT_FILE..."
|
||||
|
||||
# 从各个文件中提取的基础镜像列表
|
||||
IMAGES=(
|
||||
"python:3.13-slim",
|
||||
"ghcr.io/astral-sh/uv:0.11.26",
|
||||
"node:24-alpine",
|
||||
"node:24-slim",
|
||||
"nginx:alpine",
|
||||
"neo4j:5.26",
|
||||
"quay.io/coreos/etcd:v3.5.5",
|
||||
"minio/minio:RELEASE.2023-03-20T20-16-18Z",
|
||||
"milvusdb/milvus:v2.5.6",
|
||||
)
|
||||
|
||||
# 确保所有镜像都已下载
|
||||
for IMAGE in "${IMAGES[@]}"; do
|
||||
echo "正在拉取镜像: $IMAGE"
|
||||
docker pull $IMAGE
|
||||
done
|
||||
|
||||
# 保存所有镜像到单个 tar 文件
|
||||
echo "正在保存镜像到 tar 文件..."
|
||||
docker save ${IMAGES[@]} -o $OUTPUT_FILE
|
||||
|
||||
# 计算文件大小
|
||||
FILE_SIZE=$(du -h $OUTPUT_FILE | cut -f1)
|
||||
|
||||
echo "完成!"
|
||||
echo "所有 Docker 镜像已保存到: $OUTPUT_FILE"
|
||||
echo "文件大小: $FILE_SIZE"
|
||||
echo "使用命令: docker load -i $OUTPUT_FILE 加载镜像"
|
||||
@@ -0,0 +1,48 @@
|
||||
# 开发阶段
|
||||
FROM node:24-alpine AS development
|
||||
WORKDIR /app
|
||||
ENV TZ=Asia/Shanghai
|
||||
|
||||
# 安装 pnpm
|
||||
RUN npm install -g pnpm@latest
|
||||
|
||||
# 复制 package.json 和 pnpm-lock.yaml
|
||||
COPY ./web/package*.json ./
|
||||
COPY ./web/pnpm-lock.yaml* ./
|
||||
|
||||
# 安装依赖
|
||||
RUN pnpm install --registry=https://registry.npmmirror.com
|
||||
|
||||
# 复制源代码
|
||||
COPY ./web .
|
||||
|
||||
# 暴露端口
|
||||
EXPOSE 5173
|
||||
|
||||
# 启动开发服务器的命令在 docker-compose 文件中定义
|
||||
|
||||
# 生产阶段
|
||||
FROM node:24-alpine AS build-stage
|
||||
WORKDIR /app
|
||||
|
||||
# 安装 pnpm
|
||||
RUN npm install -g pnpm@latest
|
||||
|
||||
# 复制依赖文件
|
||||
COPY ./web/package*.json ./
|
||||
COPY ./web/pnpm-lock.yaml* ./
|
||||
|
||||
# 安装依赖
|
||||
RUN pnpm install --frozen-lockfile --registry=https://registry.npmmirror.com
|
||||
|
||||
# 复制源代码并构建
|
||||
COPY ./web .
|
||||
RUN pnpm run build
|
||||
|
||||
# 生产环境运行阶段
|
||||
FROM nginx:alpine AS production
|
||||
COPY --from=build-stage /app/dist /usr/share/nginx/html
|
||||
COPY ./docker/nginx/nginx.conf /etc/nginx/nginx.conf
|
||||
COPY ./docker/nginx/default.conf /etc/nginx/conf.d/default.conf
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in New Issue
Block a user