init project
Browse files494 unmodified lines495496497498499500501502503504505506507508509510511512513514515516517518519520521522523494 unmodified linesprint(e)outfile = get_3D_model_from_scene(outdir, scene, min_conf_thr, as_pointcloud, mask_sky,clean_depth, transparent_cams, cam_size)# also return rgb, depth and confidence imgs# depth is normalized with the max value for all images# we apply the jet colormap on the confidence mapsrgbimg = scene.imgsdepths = to_numpy(scene.get_depthmaps())confs = to_numpy([c for c in scene.im_conf])# confs = to_numpy([c for c in scene.conf_2])cmap = pl.get_cmap('jet')depths_max = max([d.max() for d in depths])depths = [d / depths_max for d in depths]confs_max = max([d.max() for d in confs])confs = [cmap(d / confs_max) for d in confs]imgs = []for i in range(len(rgbimg)):imgs.append(rgbimg[i])imgs.append(rgb(depths[i]))imgs.append(rgb(confs[i]))return scene, outfile, imgs@spaces.GPU(duration=180)def get_3D_object_from_scene(outdir, text, threshold, scene, min_conf_thr, as_pointcloud,494 unmodified lines495496497498499500501502503504505506507508509510511512513514515516517518519520521522523494 unmodified linesprint(e)# outfile = get_3D_model_from_scene(outdir, scene, min_conf_thr, as_pointcloud, mask_sky,# clean_depth, transparent_cams, cam_size)# # also return rgb, depth and confidence imgs# # depth is normalized with the max value for all images# # we apply the jet colormap on the confidence maps# rgbimg = scene.imgs# depths = to_numpy(scene.get_depthmaps())# confs = to_numpy([c for c in scene.im_conf])# # confs = to_numpy([c for c in scene.conf_2])# cmap = pl.get_cmap('jet')# depths_max = max([d.max() for d in depths])# depths = [d / depths_max for d in depths]# confs_max = max([d.max() for d in confs])# confs = [cmap(d / confs_max) for d in confs]# imgs = []# for i in range(len(rgbimg)):# imgs.append(rgbimg[i])# imgs.append(rgb(depths[i]))# imgs.append(rgb(confs[i]))# return scene, outfile, imgs@spaces.GPU(duration=180)def get_3D_object_from_scene(outdir, text, threshold, scene, min_conf_thr, as_pointcloud,
app.py+23-23