File size: 531 Bytes
e9e2aab
b45a032
 
e9e2aab
 
 
 
 
 
 
 
 
 
b45a032
e9e2aab
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import cv2
import torch
import clip
import gradio as gr
import numpy as np


# Use GPU if available
if torch.cuda.is_available():
    device = torch.device("cuda")
else:
    device = torch.device("cpu")


def manipulate_image(img, text_queries, score_threshold):
    return img


description = """
"""

demo = gr.Interface(
    manipulate_image, 
    inputs=[gr.Image(), "text", gr.Slider(0, 1, value=0.1)], 
    outputs="image",
    title="Text-guided image manipulation with StyleMC",
    description=description,
)
demo.launch()