Sandeepa's picture
Update app.py
87ae244
raw
history blame contribute delete
No virus
689 Bytes
import gradio as gr
from depth_detection import depth_detection
from mesh_network import mesh_network
from point_cloud import point_cloud
import open3d as o3d
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)
output_path = f'./meshdepth12.obj'
o3d.io.write_triangle_mesh(output_path)
return output_mesh
input_image = gr.inputs.Image(label="Input Image", type="pil")
output_object=gr.Model3D(clear_color=[0.0, 0.0, 0.0, 0.0], label="3D Model")
iface = gr.Interface(fn=reconstruction3d, inputs=input_image, outputs=output_object)
iface.launch()