|
import gradio as gr |
|
from transformers import AutoModel, AutoProcessor |
|
from PIL import Image |
|
import torch |
|
|
|
|
|
model = AutoModel.from_pretrained("zxhezexin/openlrm-mix-large-1.1") |
|
processor = AutoProcessor.from_pretrained("zxhezexin/openlrm-mix-large-1.1") |
|
|
|
|
|
def image_to_3d(image): |
|
inputs = processor(images=image, return_tensors="pt") |
|
with torch.no_grad(): |
|
outputs = model(**inputs) |
|
|
|
return "3D Output Generated" |
|
|
|
|
|
interface = gr.Interface( |
|
fn=image_to_3d, |
|
inputs=gr.Image(type="pil"), |
|
outputs="text", |
|
title="OpenLRM Mix-Large 1.1 - Image to 3D" |
|
) |
|
|
|
interface.launch() |
|
|