Spaces:
Runtime error
Runtime error
jens
commited on
Commit
·
1758fb9
1
Parent(s):
7d22d48
fixed bool maybe
Browse files- app.py +1 -1
- inference.py +4 -4
app.py
CHANGED
@@ -34,7 +34,7 @@ with block:
|
|
34 |
with gr.Column():
|
35 |
with gr.Row():
|
36 |
with gr.Column():
|
37 |
-
input_image = gr.Image(label='Input', type='pil', tool=None)
|
38 |
sam_encode_btn = gr.Button('Encode', variant='primary')
|
39 |
sam_encode_status = gr.Label('Not encoded yet')
|
40 |
masks_annotated_image = gr.AnnotatedImage(label='Segments', height=512)
|
|
|
34 |
with gr.Column():
|
35 |
with gr.Row():
|
36 |
with gr.Column():
|
37 |
+
input_image = gr.Image(label='Input', type='pil', tool=None) # mirror_webcam = False
|
38 |
sam_encode_btn = gr.Button('Encode', variant='primary')
|
39 |
sam_encode_status = gr.Label('Not encoded yet')
|
40 |
masks_annotated_image = gr.AnnotatedImage(label='Segments', height=512)
|
inference.py
CHANGED
@@ -98,10 +98,10 @@ class DepthPredictor:
|
|
98 |
# Create cubes and add them to the mesh
|
99 |
cs = [(255,0,0),(0,255,0),(0,0,255)]
|
100 |
for c,(mask, _) in zip(cs, masks):
|
101 |
-
if len(mask) == len(point_cloud):
|
102 |
-
|
103 |
-
else:
|
104 |
-
|
105 |
mask = mask.ravel()
|
106 |
point_cloud_subset, color_array_subset = point_cloud[mask], color_array[mask]
|
107 |
idxs = np.random.choice(len(point_cloud_subset), int(n_samples))
|
|
|
98 |
# Create cubes and add them to the mesh
|
99 |
cs = [(255,0,0),(0,255,0),(0,0,255)]
|
100 |
for c,(mask, _) in zip(cs, masks):
|
101 |
+
#if len(mask) == len(point_cloud):
|
102 |
+
# mask = mask.ravel()
|
103 |
+
#else:
|
104 |
+
# mask = mask.ravel()[:-1]
|
105 |
mask = mask.ravel()
|
106 |
point_cloud_subset, color_array_subset = point_cloud[mask], color_array[mask]
|
107 |
idxs = np.random.choice(len(point_cloud_subset), int(n_samples))
|