Spaces:
Running
Running
justin2341
commited on
Commit
·
8f9483b
1
Parent(s):
5bb8e25
Update demo.py
Browse files
demo.py
CHANGED
@@ -86,46 +86,18 @@ def idcard_recognition(frame):
|
|
86 |
return [html, images]
|
87 |
|
88 |
with gr.Blocks() as demo:
|
89 |
-
gr.
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
<img src="https://github.com/kby-ai/.github/assets/125717930/bcf351c5-8b7a-496e-a8f9-c236eb8ad59e" style="margin: 4px; width: 36px; height: 20px">
|
98 |
-
</span>
|
99 |
-
</h4>
|
100 |
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
)
|
106 |
-
with gr.TabItem("ID Card Recognition"):
|
107 |
-
gr.Markdown(
|
108 |
-
"""
|
109 |
-
##### Docker Hub - https://hub.docker.com/r/kbyai/idcard-recognition
|
110 |
-
```bash
|
111 |
-
sudo docker pull kbyai/idcard-recognition:latest
|
112 |
-
sudo docker run -e LICENSE="xxxxx" -p 8082:8080 -p 9002:9000 kbyai/idcard-recognition:latest
|
113 |
-
```
|
114 |
-
"""
|
115 |
-
)
|
116 |
-
with gr.Row():
|
117 |
-
with gr.Column(scale=3):
|
118 |
-
id_image_input = gr.Image(type='filepath')
|
119 |
-
gr.Examples(['idcard_examples/1.jpg', 'idcard_examples/2.jpg', 'idcard_examples/3.jpg'],
|
120 |
-
inputs=id_image_input)
|
121 |
-
id_recognition_button = gr.Button("ID Card Recognition")
|
122 |
-
with gr.Column(scale=5):
|
123 |
-
id_result_output = gr.HTML()
|
124 |
-
|
125 |
-
with gr.Column(scale=2):
|
126 |
-
image_result_output = gr.HTML()
|
127 |
-
|
128 |
-
id_recognition_button.click(idcard_recognition, inputs=id_image_input, outputs=[id_result_output, image_result_output])
|
129 |
-
gr.HTML('<a href="https://visitorbadge.io/status?path=https%3A%2F%2Fhuggingface.co%2Fspaces%2Fkby-ai%2FIDCardRecognition"><img src="https://api.visitorbadge.io/api/combined?path=https%3A%2F%2Fhuggingface.co%2Fspaces%2Fkby-ai%2FIDCardRecognition&countColor=%23263759" /></a>')
|
130 |
|
131 |
demo.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
86 |
return [html, images]
|
87 |
|
88 |
with gr.Blocks() as demo:
|
89 |
+
with gr.Row():
|
90 |
+
with gr.Column(scale=3):
|
91 |
+
id_image_input = gr.Image(type='filepath')
|
92 |
+
gr.Examples(['idcard_examples/1.jpg', 'idcard_examples/2.jpg', 'idcard_examples/3.jpg'],
|
93 |
+
inputs=id_image_input)
|
94 |
+
id_recognition_button = gr.Button("ID Card Recognition")
|
95 |
+
with gr.Column(scale=5):
|
96 |
+
id_result_output = gr.HTML()
|
|
|
|
|
|
|
97 |
|
98 |
+
with gr.Column(scale=2):
|
99 |
+
image_result_output = gr.HTML()
|
100 |
+
|
101 |
+
id_recognition_button.click(idcard_recognition, inputs=id_image_input, outputs=[id_result_output, image_result_output])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
|
103 |
demo.launch(server_name="0.0.0.0", server_port=7860)
|