"vscode:/vscode.git/clone" did not exist on "6268f20ef340b72ea549f1d20f86ef5ff988425d"
Commit 3a820305 authored by myhloli's avatar myhloli
Browse files

feat(web_api): update configuration and remove unused code

- Comment out PaddlePaddle GPU installation in Dockerfile
- Add OCR model download URL in download_models.py
- Update config version in magic-pdf.json
- Remove outdated information and simplify README.md
- Remove volume creation for PaddleOCR models in Dockerfile
parent b51ac110
...@@ -23,10 +23,10 @@ RUN apt-get update && \ ...@@ -23,10 +23,10 @@ RUN apt-get update && \
COPY requirements.txt . COPY requirements.txt .
RUN python -m venv /app/venv && \ RUN python -m venv /app/venv && \
. /app/venv/bin/activate && \ . /app/venv/bin/activate && \
pip install -r requirements.txt && \ pip install -r requirements.txt
pip uninstall -y paddlepaddle && \ # pip uninstall -y paddlepaddle && \
pip install -i https://www.paddlepaddle.org.cn/packages/stable/cu118/ \ # pip install -i https://www.paddlepaddle.org.cn/packages/stable/cu118/ \
paddlepaddle-gpu==3.0.0rc1 # paddlepaddle-gpu==3.0.0rc1
# Download models # Download models
COPY download_models.py . COPY download_models.py .
...@@ -51,8 +51,8 @@ RUN apt-get update && \ ...@@ -51,8 +51,8 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
# Create volume for paddleocr models # Create volume for paddleocr models
RUN mkdir -p /root/.paddleocr # RUN mkdir -p /root/.paddleocr
VOLUME [ "/root/.paddleocr" ] # VOLUME [ "/root/.paddleocr" ]
# Copy the app and its configuration file # Copy the app and its configuration file
COPY entrypoint.sh /app/entrypoint.sh COPY entrypoint.sh /app/entrypoint.sh
......
...@@ -18,11 +18,9 @@ docker build --build-arg http_proxy=http://127.0.0.1:7890 --build-arg https_prox ...@@ -18,11 +18,9 @@ docker build --build-arg http_proxy=http://127.0.0.1:7890 --build-arg https_prox
## 启动命令 ## 启动命令
``` ```
docker run --rm -it --gpus=all -v ./paddleocr:/root/.paddleocr -p 8000:8000 mineru-api docker run --rm -it --gpus=all -p 8000:8000 mineru-api
``` ```
初次调用 API 时会自动下载 paddleocr 的模型(约数十 MB),其余模型已包含在镜像中。
## 测试参数 ## 测试参数
访问地址: 访问地址:
...@@ -30,31 +28,4 @@ docker run --rm -it --gpus=all -v ./paddleocr:/root/.paddleocr -p 8000:8000 mine ...@@ -30,31 +28,4 @@ docker run --rm -it --gpus=all -v ./paddleocr:/root/.paddleocr -p 8000:8000 mine
``` ```
http://localhost:8000/docs http://localhost:8000/docs
http://127.0.0.1:8000/docs http://127.0.0.1:8000/docs
``` ```
\ No newline at end of file
## 旧版镜像地址
> 阿里云地址:docker pull registry.cn-beijing.aliyuncs.com/quincyqiang/mineru:0.1-models
>
> dockerhub地址:docker pull quincyqiang/mineru:0.1-models
## 旧版截图
### 启动命令
![](https://i-blog.csdnimg.cn/direct/bcff4f524ea5400db14421ba7cec4989.png)
具体截图请见博客:https://blog.csdn.net/yanqianglifei/article/details/141979684
### 启动日志
![](https://i-blog.csdnimg.cn/direct/4eb5657567e4415eba912179dca5c8aa.png)
### 测试参数
![](https://i-blog.csdnimg.cn/direct/8b3a2bc5908042268e8cc69756e331a2.png)
### 解析效果
![](https://i-blog.csdnimg.cn/direct/a54dcae834ae48d498fb595aca4212c3.png)
...@@ -8,6 +8,7 @@ if __name__ == "__main__": ...@@ -8,6 +8,7 @@ if __name__ == "__main__":
"models/Layout/YOLO/*", "models/Layout/YOLO/*",
"models/MFD/YOLO/*", "models/MFD/YOLO/*",
"models/MFR/unimernet_hf_small_2503/*", "models/MFR/unimernet_hf_small_2503/*",
"models/OCR/paddleocr_torch/*",
# "models/TabRec/TableMaster/*", # "models/TabRec/TableMaster/*",
# "models/TabRec/StructEqTable/*", # "models/TabRec/StructEqTable/*",
] ]
......
...@@ -40,5 +40,5 @@ ...@@ -40,5 +40,5 @@
"enable": false "enable": false
} }
}, },
"config_version": "1.1.1" "config_version": "1.2.0"
} }
--extra-index-url https://myhloli.github.io/wheels/
magic-pdf[full] magic-pdf[full]
fastapi fastapi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment