Spaces:
Runtime error
Runtime error
Jingkang Yang
commited on
Commit
•
397f1f8
1
Parent(s):
1833fac
update: show video
Browse files- app.py +5 -5
- open_vocab_seg/utils/predictor.py +2 -2
app.py
CHANGED
@@ -153,15 +153,15 @@ def greet(rgb_input, depth_map_input, rage_matrices_input, class_candidates):
|
|
153 |
Depth_Semantic_SAM_Mask = read_image('outputs/Depth_Semantic_SAM_Mask.png')
|
154 |
RGB_Semantic_SAM_Mask = read_image('outputs/RGB_Semantic_SAM_Mask.png')
|
155 |
Depth_map = read_image('outputs/Depth_rendered.png')
|
156 |
-
Depth_Semantic_SAM_Mask_gif = 'outputs/depth_3d_sam_mask.
|
157 |
-
RGB_Semantic_SAM_Mask_gif = 'outputs/rgb_3d_sam_mask.
|
158 |
return RGB_Semantic_SAM_Mask, RGB_Semantic_SAM_Mask_gif, Depth_map, Depth_Semantic_SAM_Mask, Depth_Semantic_SAM_Mask_gif
|
159 |
|
160 |
with gr.Blocks(analytics_enabled=False) as segrgbd_iface:
|
161 |
gr.Markdown("<div align='center'> <h2> Semantic Segment AnyRGBD </span> </h2> \
|
162 |
<a style='font-size:18px;color: #000000' href='https://github.com/Jun-CEN/SegmentAnyRGBD'> Github </div>")
|
163 |
|
164 |
-
gr.Markdown("<b> You may duplicate the space and upgrade to GPU in settings for better performance and faster inference without waiting in the queue. <a style='display:inline-block' href='https://huggingface.co/spaces/
|
165 |
#######t2v#######
|
166 |
with gr.Tab(label="Dataset: Sailvos3D"):
|
167 |
with gr.Column():
|
@@ -180,10 +180,10 @@ with gr.Blocks(analytics_enabled=False) as segrgbd_iface:
|
|
180 |
with gr.Tab(label='Result'):
|
181 |
with gr.Row():
|
182 |
RGB_Semantic_SAM_Mask_Component = gr.Image(label = "RGB_Semantic_SAM_Mask").style(width=320, height=200)
|
183 |
-
RGB_Semantic_SAM_Mask_3D_Component = gr.
|
184 |
with gr.Row():
|
185 |
Depth_Semantic_SAM_Mask_Component = gr.Image(label = "Depth_Semantic_SAM_Mask").style(width=320, height=200)
|
186 |
-
Depth_Semantic_SAM_Mask_3D_Component = gr.
|
187 |
gr.Examples(examples=[
|
188 |
[
|
189 |
'UI/sailvos3d/ex1/inputs/rgb_000160.bmp',
|
|
|
153 |
Depth_Semantic_SAM_Mask = read_image('outputs/Depth_Semantic_SAM_Mask.png')
|
154 |
RGB_Semantic_SAM_Mask = read_image('outputs/RGB_Semantic_SAM_Mask.png')
|
155 |
Depth_map = read_image('outputs/Depth_rendered.png')
|
156 |
+
Depth_Semantic_SAM_Mask_gif = 'outputs/depth_3d_sam_mask.mp4'
|
157 |
+
RGB_Semantic_SAM_Mask_gif = 'outputs/rgb_3d_sam_mask.mp4'
|
158 |
return RGB_Semantic_SAM_Mask, RGB_Semantic_SAM_Mask_gif, Depth_map, Depth_Semantic_SAM_Mask, Depth_Semantic_SAM_Mask_gif
|
159 |
|
160 |
with gr.Blocks(analytics_enabled=False) as segrgbd_iface:
|
161 |
gr.Markdown("<div align='center'> <h2> Semantic Segment AnyRGBD </span> </h2> \
|
162 |
<a style='font-size:18px;color: #000000' href='https://github.com/Jun-CEN/SegmentAnyRGBD'> Github </div>")
|
163 |
|
164 |
+
gr.Markdown("<b> You may duplicate the space and upgrade to GPU in settings for better performance and faster inference without waiting in the queue. <a style='display:inline-block' href='https://huggingface.co/spaces/jcenaa/Semantic_Segment_AnyRGBD?duplicate=true'> <img src='https://bit.ly/3gLdBN6' alt='Duplicate Space'></a> </b>")
|
165 |
#######t2v#######
|
166 |
with gr.Tab(label="Dataset: Sailvos3D"):
|
167 |
with gr.Column():
|
|
|
180 |
with gr.Tab(label='Result'):
|
181 |
with gr.Row():
|
182 |
RGB_Semantic_SAM_Mask_Component = gr.Image(label = "RGB_Semantic_SAM_Mask").style(width=320, height=200)
|
183 |
+
RGB_Semantic_SAM_Mask_3D_Component = gr.Video(label = "Video_3D_RGB_Semantic_SAM_Mask").style(width=320, height=200)
|
184 |
with gr.Row():
|
185 |
Depth_Semantic_SAM_Mask_Component = gr.Image(label = "Depth_Semantic_SAM_Mask").style(width=320, height=200)
|
186 |
+
Depth_Semantic_SAM_Mask_3D_Component = gr.Video(label = "Video_3D_Depth_Semantic_SAM_Mask").style(width=320, height=200)
|
187 |
gr.Examples(examples=[
|
188 |
[
|
189 |
'UI/sailvos3d/ex1/inputs/rgb_000160.bmp',
|
open_vocab_seg/utils/predictor.py
CHANGED
@@ -418,6 +418,6 @@ class VisualizationDemo(object):
|
|
418 |
video_out_file = '{}.gif'.format(name)
|
419 |
imageio.mimwrite(os.path.join('outputs', video_out_file), frames, duration=20)
|
420 |
|
421 |
-
|
422 |
-
|
423 |
|
|
|
418 |
video_out_file = '{}.gif'.format(name)
|
419 |
imageio.mimwrite(os.path.join('outputs', video_out_file), frames, duration=20)
|
420 |
|
421 |
+
video_out_file = '{}.mp4'.format(name)
|
422 |
+
imageio.mimwrite(os.path.join('outputs', video_out_file), frames, fps=25, quality=8)
|
423 |
|