Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -241,7 +241,8 @@ def pano_depth_to_world_points(depth):
|
|
241 |
def rgb2gray(rgb):
|
242 |
return np.dot(rgb[...,:3], [0.333, 0.333, 0.333])
|
243 |
|
244 |
-
def get_mesh(
|
|
|
245 |
global locations
|
246 |
global mesh
|
247 |
if loadall == False:
|
@@ -249,7 +250,7 @@ def get_mesh(image, depth, blur_data, loadall):
|
|
249 |
fnum = frame_selected
|
250 |
|
251 |
#print(depth["composite"])
|
252 |
-
blur_img = blur_image(
|
253 |
gdepth = rgb2gray(depth["composite"])
|
254 |
|
255 |
print('depth to gray - ok')
|
@@ -748,7 +749,7 @@ try {
|
|
748 |
return output_video_path + (locations,)
|
749 |
|
750 |
submit.click(on_submit, inputs=[input_video, model_type, coords], outputs=[processed_video, processed_zip, output_frame, output_mask, coords])
|
751 |
-
render.click(partial(get_mesh), inputs=[
|
752 |
|
753 |
example_files = os.listdir('examples')
|
754 |
example_files.sort()
|
|
|
241 |
def rgb2gray(rgb):
|
242 |
return np.dot(rgb[...,:3], [0.333, 0.333, 0.333])
|
243 |
|
244 |
+
def get_mesh(depth, blur_data, loadall):
|
245 |
+
global frames
|
246 |
global locations
|
247 |
global mesh
|
248 |
if loadall == False:
|
|
|
250 |
fnum = frame_selected
|
251 |
|
252 |
#print(depth["composite"])
|
253 |
+
blur_img = blur_image(frames[fnum], depth["composite"], blur_data)
|
254 |
gdepth = rgb2gray(depth["composite"])
|
255 |
|
256 |
print('depth to gray - ok')
|
|
|
749 |
return output_video_path + (locations,)
|
750 |
|
751 |
submit.click(on_submit, inputs=[input_video, model_type, coords], outputs=[processed_video, processed_zip, output_frame, output_mask, coords])
|
752 |
+
render.click(partial(get_mesh), inputs=[output_mask, blur_in, load_all], outputs=[result])
|
753 |
|
754 |
example_files = os.listdir('examples')
|
755 |
example_files.sort()
|