Skip to content

Commit cb534cf

Browse files
committed
Update readme of project
1 parent 5392225 commit cb534cf

File tree

2 files changed

+41
-3
lines changed

2 files changed

+41
-3
lines changed

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
A Docker image built through Github Actions with Git commit version tag
44

5+
[![Docker Image Build/Publish tag with commit](https://github.com/xiaoyao9184/docker-marker/actions/workflows/docker-image-tag-commit.yml/badge.svg)](https://github.com/xiaoyao9184/docker-marker/actions/workflows/docker-image-tag-commit.yml) [![](https://img.shields.io/docker/v/xiaoyao9184/marker)](https://hub.docker.com/r/xiaoyao9184/marker)
6+
7+
[![Docker Image Build/Publish tag with version](https://github.com/xiaoyao9184/docker-marker/actions/workflows/docker-image-tag-version.yml/badge.svg)](https://github.com/xiaoyao9184/docker-marker/actions/workflows/docker-image-tag-version.yml) [![](https://img.shields.io/docker/v/xiaoyao9184/marker/1.8.0)](https://hub.docker.com/r/xiaoyao9184/marker)
8+
9+
[![HuggingFace Model Sync](https://github.com/xiaoyao9184/docker-marker/actions/workflows/hf-model-sync.yml/badge.svg)](https://github.com/xiaoyao9184/docker-marker/actions/workflows/hf-model-sync.yml) [![](https://img.shields.io/badge/HuggingFace-model-8b2cff?logo=huggingface)](https://huggingface.co/collections/xiaoyao9184/surya-and-marker-68635abc74f33ef5d5be792d)
10+
11+
[![HuggingFace Space Sync](https://github.com/xiaoyao9184/docker-marker/actions/workflows/hf-space-sync.yml/badge.svg)](https://github.com/xiaoyao9184/docker-marker/actions/workflows/hf-space-sync.yml) [![](https://img.shields.io/badge/HuggingFace-space-ff9f44?logo=huggingface)](https://huggingface.co/spaces/xiaoyao9184/marker) ![](https://badge.mcpx.dev?type=server 'MCP Server')
12+
513
# Why
614

715
I found that Marker's Docker image is difficult to find.
@@ -36,7 +44,30 @@ and `marker_version` will be used as the tag.
3644

3745
Currently, only the `linux/amd64` platform is supported.
3846

47+
# Model
48+
49+
The models of this project will be synced to HuggingFace under the collection [xiaoyao9184/surya-and-marker](https://huggingface.co/collections/xiaoyao9184/surya-and-marker-68635abc74f33ef5d5be792d).
50+
51+
The Docker image does not include model files.
52+
When running, the required models will be automatically downloaded.
53+
54+
If you need to run offline, you must pre-download the model files and enable offline mode.
55+
See [cache/README.md](./cache/README.md) for detailed instructions.
56+
57+
# Service
58+
59+
By default, the Docker container runs the Streamlit App, which comes from the original project.
60+
61+
However, this project also provides a Gradio App, a functional reimplementation of the Streamlit version.
62+
The Gradio App supports both a UI and API interface, and can even serve as an MCP server,
63+
so it is recommended as the preferred option.
64+
65+
The source code for the Gradio App is located in the [gradio](./gradio) directory of this project.
66+
A demo of this project is also available and auto-synced on Hugging Face Spaces: [xiaoyao9184/marker](https://huggingface.co/spaces/xiaoyao9184/marker)
67+
68+
To run the Gradio App, you can do so by modifying the Docker command. see the `up.gradio` sub-directory in the [docker](./docker) directory for details.
69+
3970
# Change
4071

41-
You can fork this project and build your own image. You will need to provide the following variables: `DOCKERHUB_USERNAME`, `DOCKERHUB_TOKEN`.
72+
You can fork this project and build your own image. You will need to provide the following variables: `DOCKERHUB_USERNAME`, `DOCKERHUB_TOKEN`, `HF_USERNAME`, `HF_TOKEN`.
4273
See [this](https://github.com/docker/login-action#docker-hub) for more details.

gradio/gradio_app.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010
sys.path.append(app_path)
1111

1212
import gradio as gr
13+
import requests
14+
from contextlib import suppress
1315

1416
from marker.settings import settings
1517

1618
import base64
1719
import io
1820
import re
19-
from typing import Any, Dict
2021
import json
2122

2223
import pypdfium2
@@ -105,7 +106,9 @@ def markdown_insert_images(markdown, images):
105106
![](https://badge.mcpx.dev?type=server 'MCP Server')
106107
This app will let you try marker, a PDF -> Markdown converter. It works with any languages, and extracts images, tables, equations, etc.
107108
108-
Find the project [here](https://github.com/VikParuchuri/marker).
109+
Find the original project [here](https://github.com/VikParuchuri/marker).
110+
Or this project [here](https://github.com/xiaoyao9184/docker-marker).
111+
See the [README](./blob/main/README.md) for Spaces's metadata.
109112
""")
110113

111114
with gr.Row():
@@ -224,6 +227,10 @@ def run_marker_img(filename, page_range, force_ocr, output_format, show_blocks,
224227
- layout_image (dict or None): Visualized layout image (if debug is True, else None).
225228
- preview_image (dict or None): Preview image.
226229
"""
230+
# update counter
231+
with suppress(Exception):
232+
requests.get("https://counterapi.com/api/xiaoyao9184.github.com/view/docker-marker")
233+
227234
cli_options = {
228235
"output_format": output_format,
229236
"page_range": page_range,

0 commit comments

Comments
 (0)