Spaces:
Sleeping
Sleeping
Commit
·
34c96bd
1
Parent(s):
c8f403b
try thing
Browse files
app.py
CHANGED
|
@@ -162,8 +162,8 @@ def pipeline_callback(output_queue: SimpleQueue, pipe: Any, step_index: int, tim
|
|
| 162 |
image = pipe.vae.decode(latents / pipe.vae.config.scaling_factor, return_dict=False)[0] # type: ignore[attr-defined]
|
| 163 |
image = pipe.image_processor.postprocess(image, output_type="np").squeeze() # type: ignore[attr-defined]
|
| 164 |
|
| 165 |
-
|
| 166 |
-
|
| 167 |
|
| 168 |
return callback_kwargs
|
| 169 |
|
|
@@ -294,24 +294,24 @@ def log_to_rr(input_image, do_remove_background, sample_steps, sample_seed):
|
|
| 294 |
|
| 295 |
output_queue = SimpleQueue()
|
| 296 |
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
|
| 311 |
-
|
| 312 |
|
| 313 |
-
|
| 314 |
-
|
| 315 |
|
| 316 |
# mesh_fpath, mesh_glb_fpath = make3d(output_queue, z123_image)
|
| 317 |
|
|
|
|
| 162 |
image = pipe.vae.decode(latents / pipe.vae.config.scaling_factor, return_dict=False)[0] # type: ignore[attr-defined]
|
| 163 |
image = pipe.image_processor.postprocess(image, output_type="np").squeeze() # type: ignore[attr-defined]
|
| 164 |
|
| 165 |
+
output_queue.put(("log", "mvs/image", rr.Image(image)))
|
| 166 |
+
output_queue.put(("log", "mvs/latents", rr.Tensor(latents.squeeze())))
|
| 167 |
|
| 168 |
return callback_kwargs
|
| 169 |
|
|
|
|
| 294 |
|
| 295 |
output_queue = SimpleQueue()
|
| 296 |
|
| 297 |
+
mvs_thread = threading.Thread(target=generate_mvs, args=[output_queue, input_image, sample_steps, sample_seed])
|
| 298 |
+
mvs_thread.start()
|
| 299 |
+
|
| 300 |
+
while True:
|
| 301 |
+
msg = output_queue.get()
|
| 302 |
+
if msg[0] == "z123_image":
|
| 303 |
+
z123_image = msg[1]
|
| 304 |
+
break
|
| 305 |
+
elif msg[0] == "log":
|
| 306 |
+
entity_path = msg[1]
|
| 307 |
+
entity = msg[2]
|
| 308 |
+
rr.log(entity_path, entity)
|
| 309 |
+
yield stream.read()
|
| 310 |
|
| 311 |
+
mvs_thread.join()
|
| 312 |
|
| 313 |
+
rr.log("z123image", rr.Image(z123_image))
|
| 314 |
+
yield stream.read()
|
| 315 |
|
| 316 |
# mesh_fpath, mesh_glb_fpath = make3d(output_queue, z123_image)
|
| 317 |
|