Spaces:
Runtime error
Runtime error
import gradio as gr | |
import os | |
import skimage | |
import matplotlib.pyplot as plt | |
from PIL import Image | |
import numpy as np | |
from collections import OrderedDict | |
import torch | |
from imagebind import data | |
from imagebind.models import imagebind_model | |
from imagebind.models.imagebind_model import ModalityType | |
import torch.nn as nn | |
device = "cpu" #"cuda:0" if torch.cuda.is_available() else "cpu" | |
model = imagebind_model.imagebind_huge(pretrained=True) | |
model.eval() | |
model.to(device) | |
def generate_image(text): | |
return Image.open("./assets/ICA-Logo.png").convert("RGB") | |
# Interface do Gradio | |
iface = gr.Interface( | |
fn=generate_image, | |
inputs="text", | |
outputs="image", | |
title="Texto para Imagem", | |
description="Digite um texto e obtenha uma imagem com o texto." | |
) | |
# Executa o servidor Gradio | |
iface.launch() | |