File size: 1,248 Bytes
cea929e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ad90e4e
 
 
 
 
cea929e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
__author__ = 'Taneem Jan, taneemishere.github.io'

import gradio as gr
import main_program


# our model's i/o method that take image from gradio interface's inputs.Image()
def model_interface(image):
    return main_model(image)


# main method that call the main_program where code is generated and then compiled
def main_model(input_image):
    result = main_program.main_method(input_image)
    return result


interface_title = "<br> <p style='margin: 0% 8% 0% 8%'>Front end Code Generation with Deep Neural Networks</p>"
interface_description = """<p style='margin: 0% 8% 2% 8%; text-align: justify;text-justify: inter-word;'> Input sketch image and select the framework
and click on submit to generate</p> """

interface_article = """<br><h2 style='text-align: center;'>Creafted with care from Jude</h2> """

interface_examples = ['examples/example-1.png', 'examples/example-2.png', 'examples/example-3.png']

# a gradio interface to convert a image to HTML Code
interface = gr.Interface(
    model_interface,
    inputs='image',
    outputs='text',
    allow_flagging="manual",
    title=interface_title,
    description=interface_description,
    article=interface_article,
    examples=interface_examples
)

interface.launch(share=False)