Tonic commited on
Commit
4967985
β€’
1 Parent(s): 997a61b

add image editor howto

Browse files
Files changed (2) hide show
  1. app.py +4 -1
  2. globe.py +13 -1
app.py CHANGED
@@ -9,7 +9,7 @@ from PIL import Image
9
  import numpy as np
10
  import yaml
11
  from pathlib import Path
12
- from globe import title, description, modelinfor, joinus
13
  import uuid
14
  import tempfile
15
  import time
@@ -157,6 +157,9 @@ with gr.Blocks(theme=gr.themes.Base()) as demo:
157
  with gr.Group():
158
  gr.Markdown(modelinfor)
159
  gr.Markdown(joinus)
 
 
 
160
  with gr.Row():
161
  with gr.Column(scale=1):
162
  with gr.Group():
 
9
  import numpy as np
10
  import yaml
11
  from pathlib import Path
12
+ from globe import title, description, modelinfor, joinus, howto
13
  import uuid
14
  import tempfile
15
  import time
 
157
  with gr.Group():
158
  gr.Markdown(modelinfor)
159
  gr.Markdown(joinus)
160
+ with gr.Row():
161
+ with gr.Accordion("How to use Fine-grained OCR (Color)"):
162
+ gr.Markdown(howto)
163
  with gr.Row():
164
  with gr.Column(scale=1):
165
  with gr.Group():
globe.py CHANGED
@@ -52,4 +52,16 @@ tasks = [
52
  ]
53
 
54
  ocr_types = ["ocr", "format"]
55
- ocr_colors = ["red", "green", "blue"]
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  ]
53
 
54
  ocr_types = ["ocr", "format"]
55
+ ocr_colors = ["red", "green", "blue"]
56
+
57
+ howto = """
58
+ To use Fine-grained OCR (Color):
59
+ 1. Click on 'Fine-grained OCR (Color)' in the task dropdown.
60
+ 2. Set 'OCR Type' to 'ocr'.
61
+ 3. This will display the image editor.
62
+ 4. Upload an image to the editor.
63
+ 5. Use the drawing tools to draw a circle around the text you want to OCR.
64
+ 6. Select the color that matches your circle in the 'OCR Color' dropdown.
65
+ 7. Click 'Process Edited Image' to run the OCR on the selected area.
66
+ """
67
+