brian4dwell commited on
Commit
fab34d5
·
1 Parent(s): fbd0580

iterative image adding

Browse files
.vscode/launch.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+
5
+ {
6
+ "name": "Python: Current File (venv)",
7
+ "type": "debugpy",
8
+ "request": "launch",
9
+ "program": "${file}",
10
+ "console": "integratedTerminal",
11
+ "cwd": "${workspaceFolder}",
12
+ "envFile": "${workspaceFolder}/.env",
13
+ "python": "/home/robot_op/miniconda3/envs/stream3r/bin/python",
14
+ "justMyCode": true
15
+ },
16
+ ]
17
+ }
app.py CHANGED
@@ -211,7 +211,7 @@ def run_model(target_dir: str, model: STream3R, mode: str="causal", streaming: b
211
  print(f"Running inference in {'streaming' if streaming else 'batch'} mode...")
212
  dtype = torch.bfloat16 if torch.cuda.get_device_capability()[0] >= 8 else torch.float16
213
 
214
- session_cache_path: str | None = None
215
 
216
  with torch.no_grad():
217
  with torch.amp.autocast(dtype=dtype, device_type=device):
@@ -370,8 +370,8 @@ def update_gallery_on_upload(input_video, input_images, input_zip, session_state
370
  Handle any new uploads (video, images, or zip) and render preview.
371
  """
372
  if not input_video and not input_images and not input_zip and not session_state:
373
- default_updates = [gr.update()] * 9
374
- return (None, current_target_dir, None, None, None, *default_updates)
375
 
376
  target_dir, image_paths, session_loaded = handle_uploads(
377
  input_video,
@@ -400,7 +400,8 @@ def update_gallery_on_upload(input_video, input_images, input_zip, session_state
400
  mask_sky_update = gr.update()
401
  prediction_mode_update = gr.update()
402
 
403
- reconstruction_value = None
 
404
 
405
  if session_loaded:
406
  settings = load_session_settings(target_dir)
@@ -450,16 +451,19 @@ def update_gallery_on_upload(input_video, input_images, input_zip, session_state
450
  f"glbscene_{conf_val}_{sanitize_frame_filter_label(frame_value)}_maskb{mask_black_val}_maskw{mask_white_val}_cam{show_cam_val}_sky{mask_sky_val}_pred{pred_mode_val.replace(' ', '_')}_mode{mode_val}.glb",
451
  )
452
  if os.path.exists(glb_candidate):
453
- reconstruction_value = glb_candidate
454
  except (KeyError, AttributeError):
455
  pass
456
 
 
 
457
  return (
458
- reconstruction_value,
459
  target_dir,
460
  image_paths,
461
  message,
462
  None,
 
463
  streaming_update,
464
  mode_update,
465
  conf_update,
@@ -939,6 +943,7 @@ with gr.Blocks(
939
  dropdown,
940
  image_paths,
941
  session_file,
 
942
  False,
943
  mode,
944
  conf_thres,
@@ -974,6 +979,7 @@ with gr.Blocks(
974
  frame_filter,
975
  image_gallery,
976
  session_state_output,
 
977
  streaming,
978
  mode,
979
  conf_thres,
@@ -1141,6 +1147,7 @@ with gr.Blocks(
1141
  image_gallery,
1142
  log_output,
1143
  session_state_output,
 
1144
  streaming,
1145
  mode,
1146
  conf_thres,
 
211
  print(f"Running inference in {'streaming' if streaming else 'batch'} mode...")
212
  dtype = torch.bfloat16 if torch.cuda.get_device_capability()[0] >= 8 else torch.float16
213
 
214
+ session_cache_path: Optional[str] = None
215
 
216
  with torch.no_grad():
217
  with torch.amp.autocast(dtype=dtype, device_type=device):
 
370
  Handle any new uploads (video, images, or zip) and render preview.
371
  """
372
  if not input_video and not input_images and not input_zip and not session_state:
373
+ default_updates = [gr.update()] * 10
374
+ return (gr.update(), current_target_dir, None, None, None, *default_updates)
375
 
376
  target_dir, image_paths, session_loaded = handle_uploads(
377
  input_video,
 
400
  mask_sky_update = gr.update()
401
  prediction_mode_update = gr.update()
402
 
403
+ reconstruction_update = gr.update()
404
+ session_state_reset = gr.update()
405
 
406
  if session_loaded:
407
  settings = load_session_settings(target_dir)
 
451
  f"glbscene_{conf_val}_{sanitize_frame_filter_label(frame_value)}_maskb{mask_black_val}_maskw{mask_white_val}_cam{show_cam_val}_sky{mask_sky_val}_pred{pred_mode_val.replace(' ', '_')}_mode{mode_val}.glb",
452
  )
453
  if os.path.exists(glb_candidate):
454
+ reconstruction_update = glb_candidate
455
  except (KeyError, AttributeError):
456
  pass
457
 
458
+ session_state_reset = gr.update(value=None)
459
+
460
  return (
461
+ reconstruction_update,
462
  target_dir,
463
  image_paths,
464
  message,
465
  None,
466
+ session_state_reset,
467
  streaming_update,
468
  mode_update,
469
  conf_update,
 
943
  dropdown,
944
  image_paths,
945
  session_file,
946
+ gr.update(value=None),
947
  False,
948
  mode,
949
  conf_thres,
 
979
  frame_filter,
980
  image_gallery,
981
  session_state_output,
982
+ session_state_input,
983
  streaming,
984
  mode,
985
  conf_thres,
 
1147
  image_gallery,
1148
  log_output,
1149
  session_state_output,
1150
+ session_state_input,
1151
  streaming,
1152
  mode,
1153
  conf_thres,
demo_cache/input_images_20250917_181443_481650/images/kf_00114.jpg DELETED

Git LFS Details

  • SHA256: bb8a33b88d6e1108bf447e7a795700c7caca6a8b24c9d5fdcf777458351c9f94
  • Pointer size: 131 Bytes
  • Size of remote file: 302 kB
demo_cache/input_images_20250917_181443_481650/images/kf_00115.jpg DELETED

Git LFS Details

  • SHA256: 9125134af68ae66ab13ca042aef16940a8ef696a9436e56f72adf237fd566acc
  • Pointer size: 131 Bytes
  • Size of remote file: 293 kB
demo_cache/input_images_20250917_181443_481650/images/kf_00116.jpg DELETED

Git LFS Details

  • SHA256: ab0a3eebad61fe62f9facd1701bd12bc841ebcc9d756428288e10057f74bbf88
  • Pointer size: 131 Bytes
  • Size of remote file: 298 kB
demo_cache/input_images_20250917_181443_481650/images/kf_00117.jpg DELETED

Git LFS Details

  • SHA256: 82bc413ad43f25f0dddc5bfabbf83404ec42959df63ae4e1198f9e917bda4178
  • Pointer size: 131 Bytes
  • Size of remote file: 344 kB
demo_cache/input_images_20250917_181443_481650/images/kf_00118.jpg DELETED

Git LFS Details

  • SHA256: 42e912f2d004bd47dae8e7f44f27b3e5b84150362315e86cc578f0a4c074168f
  • Pointer size: 131 Bytes
  • Size of remote file: 349 kB
demo_cache/input_images_20250917_181443_481650/images/kf_00119.jpg DELETED

Git LFS Details

  • SHA256: 8890bb49a45b19efaa3b2e6d6fffef5d249075353a4aac3086861987485d1971
  • Pointer size: 131 Bytes
  • Size of remote file: 327 kB
demo_cache/input_images_20250917_181443_481650/images/kf_00120.jpg DELETED

Git LFS Details

  • SHA256: 6fdcf9091c7b295a5780b2ec3d9016bedd5d00c3ad9d700b2bf7fc80fc83f750
  • Pointer size: 131 Bytes
  • Size of remote file: 315 kB
stream3r/__pycache__/stream_session.cpython-311.pyc CHANGED
Binary files a/stream3r/__pycache__/stream_session.cpython-311.pyc and b/stream3r/__pycache__/stream_session.cpython-311.pyc differ