Spaces:
Runtime error
Runtime error
File size: 678 Bytes
5081207 6ece5d3 65b316e 5081207 65b316e f44d430 65b316e 5081207 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import gradio as gr
from depth_detection import depth_detection
from mesh_network import mesh_network
from point_cloud import point_cloud
from PIL import Image
import io
def reconstruction3d(input_image):
new_image, output = depth_detection(input_image,pad=16)
pcd_img = point_cloud(new_image, output)
output_mesh = mesh_network(pcd_img)
return output_mesh
def image_bytes_to_pil_image(image_bytes):
image = Image.open(io.BytesIO(image_bytes))
return image
input_image = gr.inputs.Image(label="Input Image", type="pil")
iface = gr.Interface(fn=reconstruction3d, inputs=input_image.preprocess(image_bytes_to_pil_image), outputs="image")
iface.launch() |