MCPcopy Create free account
hub / github.com/Topdu/OpenOCR / launch_demo

Function launch_demo

demo_gradio.py:119–299  ·  view source on GitHub ↗

Launch OpenOCR Gradio demo with default configuration. Args: share: Whether to create a public share link (default: False) server_port: Server port (default: 7860) server_name: Server name (default: '0.0.0.0') Returns: gr.Blocks: Gradio demo instance

(share=False, server_port=7860, server_name='0.0.0.0')

Source from the content-addressed store, hash-verified

117
118
119def launch_demo(share=False, server_port=7860, server_name='0.0.0.0'):
120 """Launch OpenOCR Gradio demo with default configuration.
121
122 Args:
123 share: Whether to create a public share link (default: False)
124 server_port: Server port (default: 7860)
125 server_name: Server name (default: '0.0.0.0')
126
127 Returns:
128 gr.Blocks: Gradio demo instance
129 """
130 custom_css = """
131body, .gradio-container {
132 font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
133}
134.app-header {
135 text-align: center;
136 max-width: 1200px;
137 margin: 20px auto !important;
138 padding: 20px;
139}
140.app-header h1 {
141 font-size: 2.5em;
142 font-weight: 700;
143 margin-bottom: 10px;
144}
145.app-header p {
146 font-size: 1.1em;
147 opacity: 0.7;
148 line-height: 1.6;
149}
150.quick-links {
151 text-align: center;
152 padding: 12px 0;
153 border: 1px solid var(--border-color-primary);
154 border-radius: 12px;
155 margin: 16px auto;
156 max-width: 1200px;
157 background: var(--background-fill-secondary);
158}
159.quick-links a {
160 margin: 0 16px;
161 font-size: 15px;
162 font-weight: 600;
163 color: var(--link-text-color);
164 text-decoration: none;
165 transition: all 0.3s ease;
166}
167.quick-links a:hover {
168 opacity: 0.8;
169 text-decoration: underline;
170}
171.image-container img {
172 max-width: 100%;
173 max-height: 480px;
174 width: auto;
175 height: auto;
176 object-fit: contain;

Callers 4

launch_openocr_demoFunction · 0.70
launch_unirec_demoFunction · 0.70
launch_opendoc_demoFunction · 0.70
demo_gradio.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected