Spaces:
Runtime error
Runtime error
PIL image fix
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ from depth_detection import depth_detection
|
|
3 |
from mesh_network import mesh_network
|
4 |
from point_cloud import point_cloud
|
5 |
from PIL import Image
|
|
|
6 |
|
7 |
def reconstruction3d(input_image):
|
8 |
|
@@ -11,6 +12,10 @@ def reconstruction3d(input_image):
|
|
11 |
output_mesh = mesh_network(pcd_img)
|
12 |
return output_mesh
|
13 |
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
16 |
iface.launch()
|
|
|
3 |
from mesh_network import mesh_network
|
4 |
from point_cloud import point_cloud
|
5 |
from PIL import Image
|
6 |
+
import io
|
7 |
|
8 |
def reconstruction3d(input_image):
|
9 |
|
|
|
12 |
output_mesh = mesh_network(pcd_img)
|
13 |
return output_mesh
|
14 |
|
15 |
+
def image_bytes_to_pil_image(image_bytes):
|
16 |
+
image = Image.open(io.BytesIO(image_bytes))
|
17 |
+
return image
|
18 |
+
|
19 |
+
input_image = gr.inputs.BytesIO(label="Input Image")
|
20 |
+
iface = gr.Interface(fn=reconstruction3d, inputs=input_image.preprocess(image_bytes_to_pil_image), outputs="image")
|
21 |
iface.launch()
|