Netrava commited on
Commit
f25a822
·
verified ·
1 Parent(s): fcc5f8d

Delete README.md

Browse files
Files changed (1) hide show
  1. README.md +0 -88
README.md DELETED
@@ -1,88 +0,0 @@
1
- # OmniParser v2.0 API
2
-
3
- This is a public API endpoint for Microsoft's OmniParser v2.0, which can parse UI screenshots and return structured data.
4
-
5
- ## Features
6
-
7
- - Parses UI screenshots into structured JSON data
8
- - Identifies interactive elements (buttons, menus, icons, etc.)
9
- - Provides captions describing the functionality of each element
10
- - Returns visualization of detected elements
11
- - Accessible via a simple REST API
12
-
13
- ## API Usage
14
-
15
- You can use this API by sending a POST request with a file upload:
16
-
17
- ```python
18
- import requests
19
-
20
- # Replace with your actual API URL after deployment
21
- OMNIPARSER_API_URL = "https://your-username-omniparser-api.hf.space/api/parse"
22
-
23
- # Upload a file
24
- files = {'image': open('screenshot.png', 'rb')}
25
-
26
- # Send request
27
- response = requests.post(OMNIPARSER_API_URL, files=files)
28
-
29
- # Get JSON result
30
- result = response.json()
31
-
32
- # Access parsed elements
33
- elements = result["elements"]
34
- for element in elements:
35
- print(f"Element {element['id']}: {element['text']} - {element['caption']}")
36
- print(f"Coordinates: {element['coordinates']}")
37
- print(f"Interactable: {element['is_interactable']}")
38
- print(f"Confidence: {element['confidence']}")
39
- print("---")
40
-
41
- # Access visualization (base64 encoded image)
42
- visualization_base64 = result["visualization"]
43
- ```
44
-
45
- ## Response Format
46
-
47
- The API returns a JSON object with the following structure:
48
-
49
- ```json
50
- {
51
- "status": "success",
52
- "elements": [
53
- {
54
- "id": 0,
55
- "text": "Button 1",
56
- "caption": "Click to submit form",
57
- "coordinates": [0.1, 0.1, 0.3, 0.2],
58
- "is_interactable": true,
59
- "confidence": 0.95
60
- },
61
- {
62
- "id": 1,
63
- "text": "Menu",
64
- "caption": "Navigation menu",
65
- "coordinates": [0.4, 0.5, 0.6, 0.6],
66
- "is_interactable": true,
67
- "confidence": 0.87
68
- }
69
- ],
70
- "visualization": "base64_encoded_image_string"
71
- }
72
- ```
73
-
74
- ## Deployment
75
-
76
- This API is deployed on Hugging Face Spaces using Gradio. The deployment is free and provides a public URL that you can use in your applications.
77
-
78
- ## Credits
79
-
80
- This API uses Microsoft's OmniParser v2.0, which is a screen parsing tool for pure vision-based GUI agents. For more information, visit the [OmniParser GitHub repository](https://github.com/microsoft/OmniParser).
81
-
82
- ## License
83
-
84
- Please note that the OmniParser models have specific licenses:
85
- - icon_detect model is under AGPL license
86
- - icon_caption is under MIT license
87
-
88
- Please refer to the LICENSE file in the folder of each model in the original repository.