Spaces:
Sleeping
Sleeping
restructirng md
Browse files- README.md +6 -1
- helper/text/about/htrflow.md +0 -0
- helper/text/help/faq.md +10 -0
- helper/text/help/fast_track.md +0 -0
- helper/text/help/stepwise.md +0 -0
- helper/text/markdown_reader.py +5 -0
- helper/text/{text_howto.py → text_help.py} +21 -0
- helper/text/text_roadmap.py +22 -9
- tabs/about_tab.py +2 -17
- tabs/help_tab.py +41 -21
- tabs/htr_tool.py +1 -1
- tabs/stepwise_htr_tool.py +5 -0
README.md
CHANGED
@@ -11,5 +11,10 @@ models:
|
|
11 |
"Riksarkivet/rtmdet_lines",
|
12 |
"Riksarkivet/satrn_htr",
|
13 |
]
|
14 |
-
datasets:
|
|
|
|
|
|
|
|
|
|
|
15 |
---
|
|
|
11 |
"Riksarkivet/rtmdet_lines",
|
12 |
"Riksarkivet/satrn_htr",
|
13 |
]
|
14 |
+
datasets:
|
15 |
+
[
|
16 |
+
"Riksarkivet/placeholder_region_segmentation",
|
17 |
+
"Riksarkivet/placeholder_htr",
|
18 |
+
"Riksarkivet/placeholder_htr",
|
19 |
+
]
|
20 |
---
|
helper/text/about/htrflow.md
ADDED
File without changes
|
helper/text/help/faq.md
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## Frequently asked questions
|
2 |
+
|
3 |
+
**Q**: <u>How do I sign up for an account?</u>
|
4 |
+
**A** : Click on the 'Sign Up' button on the top right corner of our homepage. Fill in the required details, and you'll be set up in no time!
|
5 |
+
|
6 |
+
Q: <u>Is my data secure?</u>
|
7 |
+
A: Absolutely. We prioritize user data security and have implemented robust encryption methods to ensure your data remains private and protected.
|
8 |
+
|
9 |
+
Q: <u>Who can I contact for technical support?</u>
|
10 |
+
A: Please reach out to our support team at [email protected] for any technical queries.
|
helper/text/help/fast_track.md
ADDED
File without changes
|
helper/text/help/stepwise.md
ADDED
File without changes
|
helper/text/markdown_reader.py
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
def read_markdown(file_path: str) -> str:
|
2 |
+
with open(file_path, "r") as file:
|
3 |
+
content = file.read()
|
4 |
+
|
5 |
+
return f"""{content}"""
|
helper/text/{text_howto.py → text_help.py}
RENAMED
@@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
1 |
class TextHowTo:
|
2 |
htr_tool = """
|
3 |
## Getting Started with the HTR Tool
|
@@ -180,6 +183,24 @@ print(job.result())
|
|
180 |
|
181 |
"""
|
182 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
|
184 |
if __name__ == "__main__":
|
185 |
pass
|
|
|
1 |
+
from helper.text.markdown_reader import read_markdown
|
2 |
+
|
3 |
+
|
4 |
class TextHowTo:
|
5 |
htr_tool = """
|
6 |
## Getting Started with the HTR Tool
|
|
|
183 |
|
184 |
"""
|
185 |
|
186 |
+
text_faq = read_markdown("helper/text/help/faq.md")
|
187 |
+
|
188 |
+
text_contact = """
|
189 |
+
|
190 |
+
"""
|
191 |
+
|
192 |
+
discussion = """
|
193 |
+
## Get in Touch
|
194 |
+
|
195 |
+
If you have suggestions, questions, or would like to discuss our roadmap further, please don't hesitate to reach out.
|
196 |
+
Press badge below to open a discussion on HuggingFace.
|
197 |
+
|
198 |
+
<p align="center">
|
199 |
+
<a href="https://huggingface.co/spaces/Riksarkivet/htr_demo/discussions">
|
200 |
+
<img src="https://huggingface.co/datasets/huggingface/badges/raw/main/open-a-discussion-xl-dark.svg" alt="Badge 1">
|
201 |
+
</a>
|
202 |
+
</p>"""
|
203 |
+
|
204 |
|
205 |
if __name__ == "__main__":
|
206 |
pass
|
helper/text/text_roadmap.py
CHANGED
@@ -24,17 +24,30 @@ class TextRoadmap:
|
|
24 |
|
25 |
"""
|
26 |
|
27 |
-
|
28 |
-
## Get in Touch
|
29 |
|
30 |
-
|
31 |
-
Press badge below to open a discussion on HuggingFace.
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
roadmap_image = """
|
40 |
<figure>
|
|
|
24 |
|
25 |
"""
|
26 |
|
27 |
+
changelog = """
|
|
|
28 |
|
29 |
+
## App Changelog
|
|
|
30 |
|
31 |
+
### [0.0.1] - 2023-10-19
|
32 |
+
|
33 |
+
#### Added
|
34 |
+
|
35 |
+
- Stepwise feature > Explore results > New Text diff and CER components
|
36 |
+
|
37 |
+
#### Fixed
|
38 |
+
|
39 |
+
- ..
|
40 |
+
|
41 |
+
#### Changed
|
42 |
+
|
43 |
+
- Layout in both Fast track and Stepwise to improve the UX
|
44 |
+
|
45 |
+
### Removed
|
46 |
+
|
47 |
+
- ..
|
48 |
+
|
49 |
+
|
50 |
+
"""
|
51 |
|
52 |
roadmap_image = """
|
53 |
<figure>
|
tabs/about_tab.py
CHANGED
@@ -31,24 +31,9 @@ with gr.Blocks() as about_tab:
|
|
31 |
with gr.Row():
|
32 |
gr.Markdown(TextRoadmap.text_contribution)
|
33 |
|
34 |
-
# with gr.Tab("API & Duplicate for own use"):
|
35 |
-
# with gr.Row():
|
36 |
-
# with gr.Column():
|
37 |
-
# gr.Markdown(TextHowTo.htr_tool_api_text)
|
38 |
-
# gr.Code(
|
39 |
-
# value=TextHowTo.code_for_api,
|
40 |
-
# language="python",
|
41 |
-
# interactive=False,
|
42 |
-
# show_label=False,
|
43 |
-
# )
|
44 |
-
# with gr.Column():
|
45 |
-
# gr.Markdown(TextHowTo.duplicatin_space_htr_text)
|
46 |
-
# gr.Markdown(TextHowTo.figure_htr_hardware)
|
47 |
-
# gr.Markdown(TextHowTo.duplicatin_for_privat)
|
48 |
-
|
49 |
with gr.Tab("Changelog & Roadmap"):
|
50 |
with gr.Row():
|
51 |
with gr.Column():
|
52 |
-
gr.Markdown(TextRoadmap.
|
53 |
with gr.Column():
|
54 |
-
gr.Markdown(TextRoadmap.
|
|
|
31 |
with gr.Row():
|
32 |
gr.Markdown(TextRoadmap.text_contribution)
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
with gr.Tab("Changelog & Roadmap"):
|
35 |
with gr.Row():
|
36 |
with gr.Column():
|
37 |
+
gr.Markdown(TextRoadmap.changelog)
|
38 |
with gr.Column():
|
39 |
+
gr.Markdown(TextRoadmap.roadmap)
|
tabs/help_tab.py
CHANGED
@@ -1,35 +1,55 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
from helper.text.
|
4 |
|
5 |
with gr.Blocks() as help_tab:
|
6 |
-
gr.Markdown("lorem ipsum...")
|
7 |
with gr.Tabs():
|
8 |
-
with gr.Tab("
|
9 |
-
|
|
|
|
|
|
|
|
|
10 |
|
11 |
with gr.Tab("Fast track"):
|
12 |
pass
|
13 |
with gr.Tab("Stepwise"):
|
14 |
with gr.Row():
|
15 |
-
with gr.
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
with gr.
|
21 |
-
with gr.
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
gr.Markdown(TextHowTo.stepwise_htr_tool_end)
|
31 |
|
32 |
with gr.Tab("API"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
pass
|
34 |
with gr.Tab("Duplicating for own use"):
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
from helper.text.text_help import TextHowTo
|
4 |
|
5 |
with gr.Blocks() as help_tab:
|
|
|
6 |
with gr.Tabs():
|
7 |
+
with gr.Tab("FAQ & Discussion"):
|
8 |
+
with gr.Row():
|
9 |
+
with gr.Column():
|
10 |
+
gr.Markdown(TextHowTo.text_faq)
|
11 |
+
with gr.Column():
|
12 |
+
gr.Markdown(TextHowTo.discussion)
|
13 |
|
14 |
with gr.Tab("Fast track"):
|
15 |
pass
|
16 |
with gr.Tab("Stepwise"):
|
17 |
with gr.Row():
|
18 |
+
with gr.Row(equal_height=False):
|
19 |
+
gr.Markdown(TextHowTo.stepwise_htr_tool)
|
20 |
+
with gr.Row():
|
21 |
+
gr.Markdown(TextHowTo.stepwise_htr_tool_tab_intro)
|
22 |
+
with gr.Row():
|
23 |
+
with gr.Tabs():
|
24 |
+
with gr.Tab("1. Region Segmentation"):
|
25 |
+
gr.Markdown(TextHowTo.stepwise_htr_tool_tab1)
|
26 |
+
with gr.Tab("2. Line Segmentation"):
|
27 |
+
gr.Markdown(TextHowTo.stepwise_htr_tool_tab2)
|
28 |
+
with gr.Tab("3. Transcribe Text"):
|
29 |
+
gr.Markdown(TextHowTo.stepwise_htr_tool_tab3)
|
30 |
+
with gr.Tab("4. Explore Results"):
|
31 |
+
gr.Markdown(TextHowTo.stepwise_htr_tool_tab4)
|
32 |
+
gr.Markdown(TextHowTo.stepwise_htr_tool_end)
|
|
|
33 |
|
34 |
with gr.Tab("API"):
|
35 |
+
with gr.Row():
|
36 |
+
with gr.Column():
|
37 |
+
gr.Markdown(TextHowTo.htr_tool_api_text)
|
38 |
+
gr.Code(
|
39 |
+
value=TextHowTo.code_for_api,
|
40 |
+
language="python",
|
41 |
+
interactive=False,
|
42 |
+
show_label=False,
|
43 |
+
)
|
44 |
+
with gr.Column():
|
45 |
+
gr.Markdown("output")
|
46 |
+
|
47 |
pass
|
48 |
with gr.Tab("Duplicating for own use"):
|
49 |
+
with gr.Row():
|
50 |
+
with gr.Column():
|
51 |
+
gr.Markdown(TextHowTo.duplicatin_space_htr_text)
|
52 |
+
gr.Markdown(TextHowTo.figure_htr_hardware)
|
53 |
+
|
54 |
+
with gr.Column():
|
55 |
+
gr.Markdown(TextHowTo.duplicatin_for_privat)
|
tabs/htr_tool.py
CHANGED
@@ -262,5 +262,5 @@ with gr.Blocks() as htr_tool_tab:
|
|
262 |
fast_track_output_image.select(
|
263 |
fast_track.get_text_from_coords, inputs=text_polygon_dict, outputs=selection_text_from_image_viewer
|
264 |
)
|
265 |
-
|
266 |
htr_pipeline_button.click(fn=TrafficDataHandler.store_metric_data, inputs=htr_pipeline_button_var)
|
|
|
262 |
fast_track_output_image.select(
|
263 |
fast_track.get_text_from_coords, inputs=text_polygon_dict, outputs=selection_text_from_image_viewer
|
264 |
)
|
265 |
+
|
266 |
htr_pipeline_button.click(fn=TrafficDataHandler.store_metric_data, inputs=htr_pipeline_button_var)
|
tabs/stepwise_htr_tool.py
CHANGED
@@ -6,6 +6,7 @@ import evaluate
|
|
6 |
import gradio as gr
|
7 |
|
8 |
from helper.examples.examples import DemoImages
|
|
|
9 |
from src.htr_pipeline.gradio_backend import CustomTrack, SingletonModelLoader
|
10 |
|
11 |
model_loader = SingletonModelLoader()
|
@@ -68,6 +69,8 @@ with gr.Blocks() as stepwise_htr_tool_tab:
|
|
68 |
elem_id="region_segment_button",
|
69 |
)
|
70 |
|
|
|
|
|
71 |
with gr.Column(scale=2):
|
72 |
with gr.Box():
|
73 |
with gr.Row():
|
@@ -373,3 +376,5 @@ with gr.Blocks() as stepwise_htr_tool_tab:
|
|
373 |
image_placeholder_lines,
|
374 |
],
|
375 |
)
|
|
|
|
|
|
6 |
import gradio as gr
|
7 |
|
8 |
from helper.examples.examples import DemoImages
|
9 |
+
from helper.utils import TrafficDataHandler
|
10 |
from src.htr_pipeline.gradio_backend import CustomTrack, SingletonModelLoader
|
11 |
|
12 |
model_loader = SingletonModelLoader()
|
|
|
69 |
elem_id="region_segment_button",
|
70 |
)
|
71 |
|
72 |
+
region_segment_button_var = gr.State(value="region_segment_button")
|
73 |
+
|
74 |
with gr.Column(scale=2):
|
75 |
with gr.Box():
|
76 |
with gr.Row():
|
|
|
376 |
image_placeholder_lines,
|
377 |
],
|
378 |
)
|
379 |
+
|
380 |
+
region_segment_button.click(fn=TrafficDataHandler.store_metric_data, inputs=region_segment_button_var)
|