Sanket17 commited on
Commit
7e4f6b4
·
verified ·
1 Parent(s): 41e8ff3

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +37 -53
README.md CHANGED
@@ -1,53 +1,37 @@
1
- # OmniParser API
2
-
3
- Self-hosted version of Microsoft's [OmniParser](https://huggingface.co/microsoft/OmniParser) Image-to-text model.
4
-
5
- > OmniParser is a general screen parsing tool, which interprets/converts UI screenshot to structured format, to improve existing LLM based UI agent. Training Datasets include: 1) an interactable icon detection dataset, which was curated from popular web pages and automatically annotated to highlight clickable and actionable regions, and 2) an icon description dataset, designed to associate each UI element with its corresponding function.
6
-
7
- ## Why?
8
-
9
- There's already a great HuggingFace gradio [app](https://huggingface.co/spaces/microsoft/OmniParser) for this model. It even offers an API. But
10
-
11
- - Gradio is much slower than serving the model directly (like we do here)
12
- - HF is rate-limited
13
-
14
- ## How it works
15
-
16
- If you look at the Dockerfile, we start off with the HF demo image to retrive all the weights and util functions. Then we add a simple FastAPI server (under main.py) to serve the model.
17
-
18
- ## Getting Started
19
-
20
- ### Requirements
21
-
22
- - GPU
23
- - 16 GB Ram (swap recommended)
24
-
25
- ### Locally
26
-
27
- 1. Clone the repository
28
- 2. Build the docker image: `docker build -t omni-parser-app .`
29
- 3. Run the docker container: `docker run -p 7860:7860 omni-parser-app`
30
-
31
- ### Self-hosted API
32
-
33
- I suggest hosting on [fly.io](https://fly.io) because it's quick and simple to deploy with a CLI.
34
-
35
- This repo is ready-made for deployment on fly.io (see fly.toml for configuration). Just run `fly launch` and follow the prompts.
36
-
37
- ## Docs
38
-
39
- Visit `http://localhost:7860/docs` for the API documentation. There's only one route `/process_image` which returns
40
-
41
- - The image with bounding boxes drawn on (in base64) format
42
- - The parsed elements in a list with text descriptions
43
- - The bounding box coordinates of the parsed elements
44
-
45
- ## Examples
46
-
47
- | Before Image | After Image |
48
- | ---------------------------------- | ----------------------------- |
49
- | ![Before](examples/screenshot.png) | ![After](examples/after.webp) |
50
-
51
- ## Related Projects
52
-
53
- Check out [OneQuery](https://query-rho.vercel.app), an agent that browses the web and returns structured responses for any query, simple or complex. OneQuery is built using OmniParser to enhance its capabilities.
 
1
+ ---
2
+ license: mit
3
+ title: Omniparser-api
4
+ sdk: docker
5
+ emoji: 😻
6
+ colorFrom: red
7
+ colorTo: yellow
8
+ ---
9
+
10
+ # Omniparser API
11
+
12
+ The Omniparser API is a versatile and efficient tool designed to parse, process, and analyze various types of documents or datasets using machine learning models.
13
+
14
+ ## Features
15
+
16
+ - Upload and process documents (e.g., images, PDFs).
17
+ - Detect objects, text, or patterns within uploaded files.
18
+ - Analyze and parse structured or unstructured content.
19
+ - Highly configurable thresholds for precision and flexibility.
20
+
21
+ ## How to Use
22
+
23
+ 1. **Upload a Document**: Send a file (e.g., an image or PDF) via the `/process/` endpoint.
24
+ 2. **Adjust Thresholds**: Configure `box_threshold` and `iou_threshold` for desired accuracy.
25
+ 3. **Receive Results**: Get a JSON response with parsed content and processed outputs.
26
+
27
+ ## Endpoints
28
+
29
+ - **`GET /`**: Welcome page for the API.
30
+ - **`POST /process/`**: Upload and process a document with configurable thresholds.
31
+
32
+ ## Installation
33
+
34
+ 1. Clone the repository:
35
+ ```bash
36
+ git clone https://github.com/your-username/omniparser-api.git
37
+ cd omniparser-api