import os import gradio as gr os.system("git clone https://github.com/AK391/realworld-stylegan2-encoder.git") os.chdir("realworld-stylegan2-encoder") os.system("pip install gdown") os.system("pip install dlib") os.system("gdown https://drive.google.com/uc?id=1i873OKcKjvpxiF0UBU4NzxlMMaD9qR5z") def inference(image): os.system("python scripts/test.py --ckpt ./e4e_encode_mobile_cartoon.pt --network e4e --platform torch --size 1024 --images_path "+image.name) return "out.png" title = "Encoder4editing" description = "demo for Encoder4editing. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below." article = "

Adversarial Open Domain Adaption for Sketch-to-Photo Synthesis | Github Repo

" gr.Interface( inference, gr.inputs.Image(type="file", label="Input"), gr.outputs.Image(type="file", label="Output"), title=title, description=description, article=article, enable_queue=True ).launch(debug=True)