Netrava commited on
Commit
b06bcc2
ยท
verified ยท
1 Parent(s): 67c9e81

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +180 -181
README.md CHANGED
@@ -1,181 +1,180 @@
1
-
2
- ---
3
- title: Netrava UI Detection
4
- emoji: ๐Ÿค–
5
- colorFrom: blue
6
- colorTo: purple
7
- sdk: gradio
8
- sdk_version: 3.50.2
9
- app_file: app.py
10
- pinned: false
11
- license: mit
12
- ---
13
-
14
- # ๐Ÿค– Netrava UI Detection
15
-
16
- This Hugging Face Space hosts the Netrava AI Assistant's UI detection model for automatic UI element recognition.
17
-
18
- ## โš ๏ธ IMPORTANT: Model File Required
19
-
20
- For this Space to work properly, you need to upload the `netrava_ui_model.pt` file to the root of your Space.
21
-
22
- ### How to Upload the Model:
23
-
24
- 1. Go to your Space's "Files" tab
25
- 2. Click "Upload file"
26
- 3. Select your `netrava_ui_model.pt` file
27
- 4. Wait for the upload to complete
28
- 5. Restart your Space
29
-
30
- Without this file, the app will attempt to use a generic YOLOv8n model, which won't be trained to detect UI elements.
31
-
32
- ## ๐Ÿš€ Quick Start
33
-
34
- 1. **Upload a screenshot** of any application
35
- 2. **Get instant detection** of UI elements
36
- 3. **Download annotated image** with bounding boxes
37
- 4. **Use via API** for integration
38
-
39
- ## ๐ŸŽฏ Supported UI Elements
40
-
41
- | Element Type | Description | Use Case |
42
- |--------------|-------------|----------|
43
- | ๐Ÿ”˜ **Buttons** | Clickable buttons | Navigation, actions |
44
- | ๐Ÿ“ **Text boxes** | Input fields | Data entry |
45
- | ๐Ÿ“‹ **Dropdowns** | Selection menus | Options, choices |
46
- | โ˜‘๏ธ **Checkboxes** | Toggle options | Settings, selections |
47
- | ๐ŸŽจ **Icons** | Visual symbols | Quick actions |
48
- | ๐Ÿ“‚ **Menus** | Navigation menus | App navigation |
49
- | ๐ŸชŸ **Windows** | Application windows | Window management |
50
- | ๐Ÿ’ฌ **Dialogs** | Modal dialogs | User interactions |
51
- | ๐Ÿ”— **Links** | Clickable links | Web navigation |
52
- | ๐Ÿ–ผ๏ธ **Images** | Visual content | Media elements |
53
- | ๐Ÿท๏ธ **Labels** | Text labels | Information display |
54
- | ๐Ÿ“‘ **Tabs** | Tab controls | Content organization |
55
- | ๐Ÿ› ๏ธ **Toolbars** | Tool collections | Quick access |
56
- | ๐Ÿ“Š **Status bars** | Status information | System feedback |
57
- | ๐Ÿ“œ **Scroll bars** | Scrolling controls | Content navigation |
58
-
59
- ## ๐Ÿ”Œ API Integration
60
-
61
- ### Basic Usage
62
- ```python
63
- import requests
64
-
65
- # Upload and detect
66
- response = requests.post(
67
- "https://your-username-netrava-ui-detection.hf.space/api/predict",
68
- files={"data": open("screenshot.png", "rb")}
69
- )
70
-
71
- result = response.json()
72
- print(f"Detected {len(result['detections'])} UI elements")
73
- ```
74
-
75
- ### Advanced Usage with Netrava Client
76
- ```python
77
- from netrava_client import NetravaCloudClient
78
-
79
- # Initialize client
80
- client = NetravaCloudClient("https://your-username-netrava-ui-detection.hf.space")
81
-
82
- # Detect elements
83
- detections = client.detect_ui_elements("screenshot.png")
84
-
85
- # Get annotated image
86
- annotated = client.detect_and_annotate("screenshot.png", "result.png")
87
- ```
88
-
89
- ## โš™๏ธ Configuration for Netrava
90
-
91
- Add this to your Netrava `config.json`:
92
-
93
- ```json
94
- {
95
- "cloud": {
96
- "enabled": true,
97
- "api_url": "https://your-username-netrava-ui-detection.hf.space",
98
- "fallback_local": true,
99
- "timeout": 30,
100
- "provider": "huggingface"
101
- }
102
- }
103
- ```
104
-
105
- ## ๐ŸŽฎ Model Details
106
-
107
- - **Architecture**: YOLOv8 Nano (optimized for speed)
108
- - **Training Data**: Custom UI screenshots dataset
109
- - **Classes**: 15 UI element types
110
- - **Input Size**: 640x640 pixels
111
- - **Inference Time**: ~0.5-2 seconds
112
- - **Accuracy**: 90%+ on UI elements
113
-
114
- ## ๐Ÿ”„ Response Format
115
-
116
- ```json
117
- {
118
- "success": true,
119
- "detections": [
120
- {
121
- "class": "button",
122
- "confidence": 0.95,
123
- "bbox": [100, 50, 200, 80],
124
- "center": [150, 65],
125
- "size": [100, 30]
126
- }
127
- ],
128
- "count": 1
129
- }
130
- ```
131
-
132
- ## ๐Ÿš€ Performance
133
-
134
- | Metric | Value |
135
- |--------|-------|
136
- | **Inference Speed** | 0.5-2s |
137
- | **Accuracy** | 90%+ |
138
- | **Supported Formats** | PNG, JPG, JPEG |
139
- | **Max Image Size** | 10MB |
140
- | **Concurrent Users** | Unlimited (free tier) |
141
-
142
- ## ๐Ÿ› ๏ธ Troubleshooting
143
-
144
- ### Common Issues
145
-
146
- **"Space is sleeping"**
147
- - Free tier sleeps after inactivity
148
- - First request takes ~30s to wake up
149
- - Subsequent requests are fast
150
-
151
- **"Detection failed"**
152
- - Check image format (PNG/JPG)
153
- - Ensure image size < 10MB
154
- - Verify image contains UI elements
155
-
156
- **"API timeout"**
157
- - Increase timeout in config
158
- - Check internet connection
159
- - Try smaller image size
160
-
161
- ### Error Codes
162
-
163
- | Code | Meaning | Solution |
164
- |------|---------|----------|
165
- | 500 | Model error | Check image format |
166
- | 413 | File too large | Reduce image size |
167
- | 429 | Rate limited | Wait and retry |
168
-
169
- ## ๐Ÿ“ž Support
170
-
171
- - **Documentation**: [Netrava GitHub](https://github.com/your-username/netrava)
172
- - **Issues**: Report on GitHub Issues
173
- - **Community**: Hugging Face Discussions
174
-
175
- ## ๐Ÿ“„ License
176
-
177
- MIT License - Free for commercial and personal use.
178
-
179
- ---
180
-
181
- **๐ŸŽ‰ Ready to revolutionize UI automation with AI-powered element detection!**
 
1
+ ---
2
+ title: Netrava UI Detection
3
+ emoji: ๐Ÿค–
4
+ colorFrom: blue
5
+ colorTo: purple
6
+ sdk: gradio
7
+ sdk_version: 5.36.2
8
+ app_file: app.py
9
+ pinned: false
10
+ license: mit
11
+ ---
12
+
13
+ # ๐Ÿค– Netrava UI Detection
14
+
15
+ This Hugging Face Space hosts the Netrava AI Assistant's UI detection model for automatic UI element recognition.
16
+
17
+ ## โš ๏ธ IMPORTANT: Model File Required
18
+
19
+ For this Space to work properly, you need to upload the `netrava_ui_model.pt` file to the root of your Space.
20
+
21
+ ### How to Upload the Model:
22
+
23
+ 1. Go to your Space's "Files" tab
24
+ 2. Click "Upload file"
25
+ 3. Select your `netrava_ui_model.pt` file
26
+ 4. Wait for the upload to complete
27
+ 5. Restart your Space
28
+
29
+ Without this file, the app will attempt to use a generic YOLOv8n model, which won't be trained to detect UI elements.
30
+
31
+ ## ๐Ÿš€ Quick Start
32
+
33
+ 1. **Upload a screenshot** of any application
34
+ 2. **Get instant detection** of UI elements
35
+ 3. **Download annotated image** with bounding boxes
36
+ 4. **Use via API** for integration
37
+
38
+ ## ๐ŸŽฏ Supported UI Elements
39
+
40
+ | Element Type | Description | Use Case |
41
+ |--------------|-------------|----------|
42
+ | ๐Ÿ”˜ **Buttons** | Clickable buttons | Navigation, actions |
43
+ | ๐Ÿ“ **Text boxes** | Input fields | Data entry |
44
+ | ๐Ÿ“‹ **Dropdowns** | Selection menus | Options, choices |
45
+ | โ˜‘๏ธ **Checkboxes** | Toggle options | Settings, selections |
46
+ | ๐ŸŽจ **Icons** | Visual symbols | Quick actions |
47
+ | ๐Ÿ“‚ **Menus** | Navigation menus | App navigation |
48
+ | ๐ŸชŸ **Windows** | Application windows | Window management |
49
+ | ๐Ÿ’ฌ **Dialogs** | Modal dialogs | User interactions |
50
+ | ๐Ÿ”— **Links** | Clickable links | Web navigation |
51
+ | ๐Ÿ–ผ๏ธ **Images** | Visual content | Media elements |
52
+ | ๐Ÿท๏ธ **Labels** | Text labels | Information display |
53
+ | ๐Ÿ“‘ **Tabs** | Tab controls | Content organization |
54
+ | ๐Ÿ› ๏ธ **Toolbars** | Tool collections | Quick access |
55
+ | ๐Ÿ“Š **Status bars** | Status information | System feedback |
56
+ | ๐Ÿ“œ **Scroll bars** | Scrolling controls | Content navigation |
57
+
58
+ ## ๐Ÿ”Œ API Integration
59
+
60
+ ### Basic Usage
61
+ ```python
62
+ import requests
63
+
64
+ # Upload and detect
65
+ response = requests.post(
66
+ "https://your-username-netrava-ui-detection.hf.space/api/predict",
67
+ files={"data": open("screenshot.png", "rb")}
68
+ )
69
+
70
+ result = response.json()
71
+ print(f"Detected {len(result['detections'])} UI elements")
72
+ ```
73
+
74
+ ### Advanced Usage with Netrava Client
75
+ ```python
76
+ from netrava_client import NetravaCloudClient
77
+
78
+ # Initialize client
79
+ client = NetravaCloudClient("https://your-username-netrava-ui-detection.hf.space")
80
+
81
+ # Detect elements
82
+ detections = client.detect_ui_elements("screenshot.png")
83
+
84
+ # Get annotated image
85
+ annotated = client.detect_and_annotate("screenshot.png", "result.png")
86
+ ```
87
+
88
+ ## โš™๏ธ Configuration for Netrava
89
+
90
+ Add this to your Netrava `config.json`:
91
+
92
+ ```json
93
+ {
94
+ "cloud": {
95
+ "enabled": true,
96
+ "api_url": "https://your-username-netrava-ui-detection.hf.space",
97
+ "fallback_local": true,
98
+ "timeout": 30,
99
+ "provider": "huggingface"
100
+ }
101
+ }
102
+ ```
103
+
104
+ ## ๐ŸŽฎ Model Details
105
+
106
+ - **Architecture**: YOLOv8 Nano (optimized for speed)
107
+ - **Training Data**: Custom UI screenshots dataset
108
+ - **Classes**: 15 UI element types
109
+ - **Input Size**: 640x640 pixels
110
+ - **Inference Time**: ~0.5-2 seconds
111
+ - **Accuracy**: 90%+ on UI elements
112
+
113
+ ## ๐Ÿ”„ Response Format
114
+
115
+ ```json
116
+ {
117
+ "success": true,
118
+ "detections": [
119
+ {
120
+ "class": "button",
121
+ "confidence": 0.95,
122
+ "bbox": [100, 50, 200, 80],
123
+ "center": [150, 65],
124
+ "size": [100, 30]
125
+ }
126
+ ],
127
+ "count": 1
128
+ }
129
+ ```
130
+
131
+ ## ๐Ÿš€ Performance
132
+
133
+ | Metric | Value |
134
+ |--------|-------|
135
+ | **Inference Speed** | 0.5-2s |
136
+ | **Accuracy** | 90%+ |
137
+ | **Supported Formats** | PNG, JPG, JPEG |
138
+ | **Max Image Size** | 10MB |
139
+ | **Concurrent Users** | Unlimited (free tier) |
140
+
141
+ ## ๐Ÿ› ๏ธ Troubleshooting
142
+
143
+ ### Common Issues
144
+
145
+ **"Space is sleeping"**
146
+ - Free tier sleeps after inactivity
147
+ - First request takes ~30s to wake up
148
+ - Subsequent requests are fast
149
+
150
+ **"Detection failed"**
151
+ - Check image format (PNG/JPG)
152
+ - Ensure image size < 10MB
153
+ - Verify image contains UI elements
154
+
155
+ **"API timeout"**
156
+ - Increase timeout in config
157
+ - Check internet connection
158
+ - Try smaller image size
159
+
160
+ ### Error Codes
161
+
162
+ | Code | Meaning | Solution |
163
+ |------|---------|----------|
164
+ | 500 | Model error | Check image format |
165
+ | 413 | File too large | Reduce image size |
166
+ | 429 | Rate limited | Wait and retry |
167
+
168
+ ## ๐Ÿ“ž Support
169
+
170
+ - **Documentation**: [Netrava GitHub](https://github.com/your-username/netrava)
171
+ - **Issues**: Report on GitHub Issues
172
+ - **Community**: Hugging Face Discussions
173
+
174
+ ## ๐Ÿ“„ License
175
+
176
+ MIT License - Free for commercial and personal use.
177
+
178
+ ---
179
+
180
+ **๐ŸŽ‰ Ready to revolutionize UI automation with AI-powered element detection!**