frontend/__init__.py: general improvements, but still kinda wip
This commit is contained in:
parent
ed80c3056f
commit
6f2697de1c
@ -20,6 +20,8 @@ img_dir = '../../usable_imgs/'
|
||||
cv2.namedWindow('Input Image')
|
||||
cv2.namedWindow('Predicted Disparity')
|
||||
|
||||
signal.signal(signal.SIGUSR1, lambda *args: print('not setup yet'))
|
||||
|
||||
vis = o3d.visualization.VisualizerWithKeyCallback()
|
||||
viscont = o3d.visualization.ViewControl()
|
||||
# vis.register_key_callback(99)
|
||||
@ -31,7 +33,7 @@ K = np.array([[567.6, 0, 324.7], [0, 570.2, 250.1], [0, 0, 1]], dtype=np.float32
|
||||
|
||||
good_models = [260, 183]
|
||||
interesting = [214, ]
|
||||
# new ganz gut bei ca 175
|
||||
# new ganz gut bei ca 175, 235
|
||||
verbose = False
|
||||
|
||||
running_tasks = set()
|
||||
@ -90,7 +92,7 @@ def normalize_and_colormap(img):
|
||||
def reproject(disparity_img):
|
||||
print('reprojecting')
|
||||
baseline = 0.075
|
||||
depth_img = baseline * K[0][0] / disparity_img
|
||||
depth_img = baseline * K[0][0] / (disparity_img + 1)
|
||||
pointcloud = o3d.geometry.PointCloud()
|
||||
intrinsics = o3d.pybind.camera.PinholeCameraIntrinsic()
|
||||
print('setting intrinsics')
|
||||
@ -131,10 +133,14 @@ def reproject(disparity_img):
|
||||
# dpcd.transform(flip_transform)
|
||||
pcd.remove_statistical_outlier(nb_neighbors=20, std_ratio=2.0)
|
||||
print('drawing pointcloud')
|
||||
# vis.clear_geometries()
|
||||
# vis.add_geometry(pcd, reset_bounding_box=True)
|
||||
# viscont.rotate(250, 500)
|
||||
vis.update_geometry(pcd)
|
||||
vis.clear_geometries()
|
||||
vis.add_geometry(pcd, reset_bounding_box=True)
|
||||
viscont = vis.get_view_control()
|
||||
viscont.translate(280, 800, yo=-900)
|
||||
viscont.camera_local_rotate(-180, 250)
|
||||
viscont.rotate(100, 0)
|
||||
# viscont.camera_local_translate(forward=-5., right=-10., up=10.)
|
||||
# vis.update_geometry(pcd)
|
||||
vis.poll_events()
|
||||
vis.update_renderer()
|
||||
|
||||
@ -294,9 +300,6 @@ def create_task(*args):
|
||||
# return task
|
||||
|
||||
|
||||
signal.signal(signal.SIGUSR1, create_task)
|
||||
|
||||
|
||||
async def run_test(img_dir, iterate_checkpoints):
|
||||
img_dir = list(os.scandir(img_dir))
|
||||
for epoch in range(175, 270):
|
||||
@ -322,10 +325,11 @@ async def main():
|
||||
# change_epoch(good_models[1])
|
||||
# change_epoch('latest')
|
||||
o3d.utility.set_verbosity_level(o3d.utility.VerbosityLevel.Info)
|
||||
signal.signal(signal.SIGUSR1, create_task)
|
||||
|
||||
change_epoch(150)
|
||||
change_minimal_data(False)
|
||||
await asyncio.sleep(50000)
|
||||
# await asyncio.sleep(50000)
|
||||
|
||||
# signal.signal(signal.SIGBUS, lambda x: print('received sigbus'))
|
||||
# loop = asyncio.get_running_loop()
|
||||
@ -335,7 +339,7 @@ async def main():
|
||||
# create_task()
|
||||
# await asyncio.sleep(0.1)
|
||||
# await run_test(img_dir, iterate_checkpoints)
|
||||
await asyncio.sleep(50000)
|
||||
await asyncio.sleep(5)
|
||||
# print('[main] slept')
|
||||
# if use_live_data:
|
||||
# signal.pause()
|
||||
|
Loading…
Reference in New Issue
Block a user