init project
Browse files500 unmodified lines50150250350450550650750850951051151251351451551651751851952052152252383 unmodified lines6076086096106116126136146 unmodified lines621622623624625626627500 unmodified lines# 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,83 unmodified linesfind_btn = gradio.Button("Find")outmodel = gradio.Model3D()outgallery = gradio.Gallery(label='rgb,depth,confidence', columns=3, height="100%",visible=False)# eventsscenegraph_type.change(set_scenegraph_options,6 unmodified linesinputs=[inputfiles, schedule, niter, min_conf_thr, as_pointcloud,mask_sky, clean_depth, transparent_cams, cam_size,scenegraph_type, winsize, refid],outputs=[scene, outmodel, outgallery])min_conf_thr.release(fn=model_from_scene_fun,inputs=[scene, min_conf_thr, as_pointcloud, mask_sky,clean_depth, transparent_cams, cam_size],500 unmodified lines50150250350450550650750850951051151251351451551651751851952052152252383 unmodified lines6076086096106116126136146 unmodified lines621622623624625626627500 unmodified lines# 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,83 unmodified linesfind_btn = gradio.Button("Find")outmodel = gradio.Model3D()# outgallery = gradio.Gallery(label='rgb,depth,confidence', columns=3, height="100%",# visible=False)# eventsscenegraph_type.change(set_scenegraph_options,6 unmodified linesinputs=[inputfiles, schedule, niter, min_conf_thr, as_pointcloud,mask_sky, clean_depth, transparent_cams, cam_size,scenegraph_type, winsize, refid],outputs=[scene, outmodel]) # , outgallerymin_conf_thr.release(fn=model_from_scene_fun,inputs=[scene, min_conf_thr, as_pointcloud, mask_sky,clean_depth, transparent_cams, cam_size],
app.py+20-20