Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
@@ -252,7 +252,7 @@ def sam_process(input_first_frame_image, checkpoint, tracking_points, trackings_
|
|
252 |
plt.savefig(output_filename, format='jpg')
|
253 |
plt.close()
|
254 |
|
255 |
-
|
256 |
#### PROPAGATION ####
|
257 |
|
258 |
# Define a directory to save the JPEG images
|
@@ -289,10 +289,10 @@ def sam_process(input_first_frame_image, checkpoint, tracking_points, trackings_
|
|
289 |
|
290 |
# Close the plot
|
291 |
plt.close()
|
292 |
-
|
293 |
# OLD
|
294 |
|
295 |
-
return output_filename
|
296 |
|
297 |
with gr.Blocks() as demo:
|
298 |
first_frame_path = gr.State()
|
@@ -325,6 +325,7 @@ with gr.Blocks() as demo:
|
|
325 |
submit_btn = gr.Button("Submit")
|
326 |
with gr.Column():
|
327 |
output_result = gr.Image()
|
|
|
328 |
# output_result_mask = gr.Image()
|
329 |
|
330 |
clear_points_btn.click(
|
@@ -351,7 +352,7 @@ with gr.Blocks() as demo:
|
|
351 |
submit_btn.click(
|
352 |
fn = sam_process,
|
353 |
inputs = [input_first_frame_image, checkpoint, tracking_points, trackings_input_label, frames_output_dir],
|
354 |
-
outputs = [output_result]
|
355 |
)
|
356 |
|
357 |
demo.launch(show_api=False, show_error=True)
|
|
|
252 |
plt.savefig(output_filename, format='jpg')
|
253 |
plt.close()
|
254 |
|
255 |
+
|
256 |
#### PROPAGATION ####
|
257 |
|
258 |
# Define a directory to save the JPEG images
|
|
|
289 |
|
290 |
# Close the plot
|
291 |
plt.close()
|
292 |
+
|
293 |
# OLD
|
294 |
|
295 |
+
return output_filename, jpeg_images
|
296 |
|
297 |
with gr.Blocks() as demo:
|
298 |
first_frame_path = gr.State()
|
|
|
325 |
submit_btn = gr.Button("Submit")
|
326 |
with gr.Column():
|
327 |
output_result = gr.Image()
|
328 |
+
output_propagated = gr.Gallery()
|
329 |
# output_result_mask = gr.Image()
|
330 |
|
331 |
clear_points_btn.click(
|
|
|
352 |
submit_btn.click(
|
353 |
fn = sam_process,
|
354 |
inputs = [input_first_frame_image, checkpoint, tracking_points, trackings_input_label, frames_output_dir],
|
355 |
+
outputs = [output_result, output_propagated]
|
356 |
)
|
357 |
|
358 |
demo.launch(show_api=False, show_error=True)
|