Spaces:
Starting
Starting
Update app.py
Browse files
app.py
CHANGED
@@ -239,14 +239,15 @@ def get_mesh(image, blur_data, loadall):
|
|
239 |
global mesh
|
240 |
if loadall == False:
|
241 |
mesh = []
|
242 |
-
|
243 |
-
imgs = np.array_split(image, 2)
|
244 |
-
image = imgs[0]
|
245 |
-
depth = imgs[1]
|
246 |
fnum = frame_selected
|
247 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
248 |
|
249 |
-
gdepth = rgb2gray(depth[fnum][0])
|
250 |
print('depth to gray - ok')
|
251 |
points = pano_depth_to_world_points(gdepth)
|
252 |
pts3d = points[0]
|
@@ -307,7 +308,7 @@ def blur_image(image, depth, blur_data):
|
|
307 |
def loadurl(url):
|
308 |
return url
|
309 |
|
310 |
-
def select_frame(v):
|
311 |
global frame_selected
|
312 |
global masks
|
313 |
masks[frame_selected] = v
|
|
|
239 |
global mesh
|
240 |
if loadall == False:
|
241 |
mesh = []
|
|
|
|
|
|
|
|
|
242 |
fnum = frame_selected
|
243 |
+
|
244 |
+
if fnum < len(image)/2:
|
245 |
+
blur_img = blur_image(image[fnum][0], image[fnum+len(image)/2][0], blur_data)
|
246 |
+
gdepth = rgb2gray(image[fnum+len(image)/2][0])
|
247 |
+
else:
|
248 |
+
blur_img = blur_image(image[fnum-len(image)/2][0], image[fnum][0], blur_data)
|
249 |
+
gdepth = rgb2gray(image[fnum][0])
|
250 |
|
|
|
251 |
print('depth to gray - ok')
|
252 |
points = pano_depth_to_world_points(gdepth)
|
253 |
pts3d = points[0]
|
|
|
308 |
def loadurl(url):
|
309 |
return url
|
310 |
|
311 |
+
def select_frame(v, evt: gr.EventData):
|
312 |
global frame_selected
|
313 |
global masks
|
314 |
masks[frame_selected] = v
|