File size: 596 Bytes
b53c295
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import gradio as gr
from transformers import pipeline

def face_projection(text):
    processed_text = preprocess_text(text)

    face_image = generate_face_image(processed_text)

    return face_image

def preprocess_text(text):
    return text

def generate_face_image(processed_text):
    face_projection_pipeline = pipeline("text2image", model="Purz/face-projection")

    face_image = face_projection_pipeline(processed_text)

    return face_image

iface = gr.Interface(
    fn=face_projection,
    inputs="text",
    outputs="image",
    title="Face Projection from Text"
)

iface.launch()