CoolFace
Apppublic

de3sec/Front-end-code-generation-from-images

sourceHugging Faceafl-3.0updated 4y agoView on Hugging Face
1likes
app.py39 linesDownload Raw Back to root
1__author__ = 'Taneem Jan, taneemishere.github.io'2 3import gradio as gr4import main_program5 6 7# our model's i/o method that take image from gradio interface's inputs.Image()8def model_interface(image):9    return main_model(image)10 11 12# main method that call the main_program where code is generated and then compiled13def main_model(input_image):14    result = main_program.main_method(input_image)15    return result16 17 18interface_title = "<br> <p style='margin: 0% 8% 0% 8%'>Front end Code Generation with Deep Neural Networks</p>"19interface_description = """<p style='margin: 0% 8% 2% 8%; text-align: justify;text-justify: inter-word;'> Input sketch image and select the framework20and click on submit to generate</p> """21 22interface_article = """<br><h2 style='text-align: center;'>Creafted with care from Jude</h2> """23 24interface_examples = ['examples/example-1.png', 'examples/example-2.png', 'examples/example-3.png']25 26# a gradio interface to convert a image to HTML Code27interface = gr.Interface(28    model_interface,29    inputs='image',30    outputs='text',31    allow_flagging="manual",32    title=interface_title,33    description=interface_description,34    article=interface_article,35    examples=interface_examples36)37 38interface.launch(share=False)39