02alexander commited on
Commit
9e0db6d
β€’
1 Parent(s): 4ccfc8b

debug print threading ident

Browse files
Files changed (1) hide show
  1. app.py +20 -13
app.py CHANGED
@@ -266,24 +266,31 @@ def make3d(images):
266
 
267
  return mesh_fpath, mesh_glb_fpath
268
 
269
- @rr.thread_local_stream("InstantMesh_visualization")
 
 
 
 
270
  def log_to_rr(input_image, do_remove_background, sample_steps, sample_seed):
271
- preprocessed_image = preprocess(input_image, do_remove_background)
272
 
273
- stream = rr.binary_stream()
 
274
 
275
- rr.log("preprocessed_image", rr.Image(preprocessed_image))
276
 
277
- yield stream.read()
278
 
279
- print(threading.get_ident())
280
- z123_out = generate_mvs(input_image, sample_steps, sample_seed)
281
- print(z123_out)
282
- for image in z123_out.images:
283
- rr.log("z123image", rr.Image(image))
284
- yield stream.read()
285
- yield stream.read()
286
- pass
 
 
 
287
 
288
  _HEADER_ = '''
289
  <h2><b>Official πŸ€— Gradio Demo</b></h2><h2><a href='https://github.com/TencentARC/InstantMesh' target='_blank'><b>InstantMesh: Efficient 3D Mesh Generation from a Single Image with Sparse-view Large Reconstruction Models</b></a></h2>
 
266
 
267
  return mesh_fpath, mesh_glb_fpath
268
 
269
+ @spaces.GPU
270
+ def print_thread_ident_from_gpu():
271
+ print(threading.get_ident())
272
+
273
+ @rr.thread_local_stream("InstantMesh")
274
  def log_to_rr(input_image, do_remove_background, sample_steps, sample_seed):
 
275
 
276
+ print(threading.get_ident())
277
+ print_thread_ident_from_gpu()
278
 
279
+ # preprocessed_image = preprocess(input_image, do_remove_background)
280
 
281
+ # stream = rr.binary_stream()
282
 
283
+ # rr.log("preprocessed_image", rr.Image(preprocessed_image))
284
+
285
+ # yield stream.read()
286
+
287
+ # z123_out = generate_mvs(input_image, sample_steps, sample_seed)
288
+ # print(z123_out)
289
+ # for image in z123_out.images:
290
+ # rr.log("z123image", rr.Image(image))
291
+ # yield stream.read()
292
+ # yield stream.read()
293
+ # pass
294
 
295
  _HEADER_ = '''
296
  <h2><b>Official πŸ€— Gradio Demo</b></h2><h2><a href='https://github.com/TencentARC/InstantMesh' target='_blank'><b>InstantMesh: Efficient 3D Mesh Generation from a Single Image with Sparse-view Large Reconstruction Models</b></a></h2>