stylemc-demo / app.py
adirik's picture
first commit
e9e2aab
raw
history blame
518 Bytes
import torch
import cv2
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()