Spaces:
Configuration error
Configuration error
Commit ·
c8f403b
1
Parent(s): a0fdd41
isolate picke error
Browse files161 unmodified lines16216316416516616716816917017117217317471 unmodified lines24624724824925025125219 unmodified lines2722732742752762772782792802812822832847 unmodified lines292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325161 unmodified linesimage = pipe.vae.decode(latents / pipe.vae.config.scaling_factor, return_dict=False)[0] # type: ignore[attr-defined]image = pipe.image_processor.postprocess(image, output_type="np").squeeze() # type: ignore[attr-defined]output_queue.put(("log", "mvs/image", rr.Image(image)))output_queue.put(("log", "mvs/latents", rr.Tensor(latents.squeeze())))return callback_kwargs@spaces.GPUdef generate_mvs(input_image, sample_steps, sample_seed, output_queue: SimpleQueue):seed_everything(sample_seed)71 unmodified linesrender_size=render_size,)['images_rgb']print(f'type(framee)={type(frame)}')output_queue.put(("log", "3dvideo", rr.Image(frame)))# frames.append(frame)19 unmodified linesvertices, faces, vertex_colors = mesh_outvertices = vertices[:, [1, 2, 0]]print(f'type(vertices)={type(vertices)}')save_glb(vertices, faces, vertex_colors, mesh_glb_fpath)save_obj(vertices, faces, vertex_colors, mesh_fpath)print(f"Mesh saved to {mesh_fpath}")return mesh_fpath, mesh_glb_fpath@rr.thread_local_stream("InstantMesh")def log_to_rr(input_image, do_remove_background, sample_steps, sample_seed):7 unmodified linesoutput_queue = SimpleQueue()mvs_thread = threading.Thread(target=generate_mvs, args=[input_image, sample_steps, sample_seed, output_queue])mvs_thread.start()while True:msg = output_queue.get()if msg[0] == "z123_image":z123_image = msg[1]breakelif msg[0] == "log":entity_path = msg[1]entity = msg[2]rr.log(entity_path, entity)yield stream.read()mvs_thread.join()rr.log("z123image", rr.Image(z123_image))yield stream.read()mesh_fpath, mesh_glb_fpath = make3d(output_queue, z123_image)while not output_queue.empty():msg = output_queue.get()if msg[0] == "log":entity_path = msg[1]entity = msg[2]rr.log(entity_path, entity)yield stream.read()_HEADER_ = '''161 unmodified lines16216316416516616716816917017117217317471 unmodified lines24624724824925025125219 unmodified lines2722732742752762772782792802812822832842852867 unmodified lines294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327161 unmodified linesimage = pipe.vae.decode(latents / pipe.vae.config.scaling_factor, return_dict=False)[0] # type: ignore[attr-defined]image = pipe.image_processor.postprocess(image, output_type="np").squeeze() # type: ignore[attr-defined]# output_queue.put(("log", "mvs/image", rr.Image(image)))# output_queue.put(("log", "mvs/latents", rr.Tensor(latents.squeeze())))return callback_kwargs@spaces.GPUdef generate_mvs(output_queue: SimpleQueue, input_image, sample_steps, sample_seed):seed_everything(sample_seed)71 unmodified linesrender_size=render_size,)['images_rgb']print(f'type(frame)={type(frame)}')output_queue.put(("log", "3dvideo", rr.Image(frame)))# frames.append(frame)19 unmodified linesvertices, faces, vertex_colors = mesh_outvertices = vertices[:, [1, 2, 0]]print(f'type(vertices)={type(vertices)}')print(f'type(faces)={type(faces)}')print(f'type(vertex_colors)={type(vertex_colors)}')save_glb(vertices, faces, vertex_colors, mesh_glb_fpath)save_obj(vertices, faces, vertex_colors, mesh_fpath)print(f"Mesh saved to {mesh_fpath}")return mesh_out@rr.thread_local_stream("InstantMesh")def log_to_rr(input_image, do_remove_background, sample_steps, sample_seed):7 unmodified linesoutput_queue = SimpleQueue()# mvs_thread = threading.Thread(target=generate_mvs, args=[output_queue, input_image, sample_steps, sample_seed])# mvs_thread.start()# while True:# msg = output_queue.get()# if msg[0] == "z123_image":# z123_image = msg[1]# break# elif msg[0] == "log":# entity_path = msg[1]# entity = msg[2]# rr.log(entity_path, entity)# yield stream.read()# mvs_thread.join()# rr.log("z123image", rr.Image(z123_image))# yield stream.read()# mesh_fpath, mesh_glb_fpath = make3d(output_queue, z123_image)# while not output_queue.empty():# msg = output_queue.get()# if msg[0] == "log":# entity_path = msg[1]# entity = msg[2]# rr.log(entity_path, entity)# yield stream.read()_HEADER_ = '''
app.py+31-29