CoolFace
Apppublic

Sandeepa/MeshReconstruction3D

sourceHugging Facemitupdated 3y agoView on Hugging Face
0likes
app.py20 linesDownload Raw Back to root
1import gradio as gr2from depth_detection import depth_detection3from mesh_network import mesh_network4from point_cloud import point_cloud5import open3d as o3d6 7def reconstruction3d(input_image):8 9    new_image, output = depth_detection(input_image,pad=16)10    pcd_img = point_cloud(new_image, output)11    output_mesh = mesh_network(pcd_img)12    output_path = f'./meshdepth12.obj'13    o3d.io.write_triangle_mesh(output_path)14    return output_mesh15 16 17input_image = gr.inputs.Image(label="Input Image", type="pil")18output_object=gr.Model3D(clear_color=[0.0, 0.0, 0.0, 0.0],  label="3D Model")19iface = gr.Interface(fn=reconstruction3d, inputs=input_image, outputs=output_object)20iface.launch()