cyun9286 commited on
Commit
748a455
1 Parent(s): a779ffd
app.py CHANGED
@@ -116,6 +116,7 @@ def generate_monocular_depth_maps(img_list, depth_prior_name):
116
  depth = pipe(image)["predicted_depth"].numpy()
117
  depth = cv2.resize(depth[0], image.size, interpolation=cv2.INTER_LANCZOS4)
118
  focallength_px = 200
 
119
  depth_list.append(depth)
120
  focallength_px_list.append(focallength_px)
121
  #np.savez_compressed(path_depthanything, depth=depth)
@@ -138,6 +139,7 @@ def local_get_reconstructed_scene(filelist, min_conf_thr, as_pointcloud, mask_sk
138
  model = AsymmetricCroCo3DStereo.from_pretrained(weights_path).to(device)
139
  output = inference(pairs, model, device, batch_size=batch_size, verbose=not silent)
140
  mode = GlobalAlignerMode.PointCloudOptimizer
 
141
  scene = global_aligner(output, device=device, mode=mode, verbose=not silent, shared_focal = True, temporal_smoothing_weight=0.01, translation_weight=1.0,
142
  flow_loss_weight=0.01, flow_loss_start_epoch=0.1, flow_loss_thre=25, use_self_mask=True,
143
  num_total_iter=300, empty_cache= len(filelist) > 72)
@@ -192,13 +194,6 @@ with gradio.Blocks(css=css, title=title, delete_cache=(gradio_delete_cache, grad
192
  [os.path.join(HERE_PATH, 'example/bear/00000.jpg'),
193
  os.path.join(HERE_PATH, 'example/bear/00001.jpg'),
194
  os.path.join(HERE_PATH, 'example/bear/00002.jpg'),
195
- os.path.join(HERE_PATH, 'example/bear/00003.jpg'),
196
- os.path.join(HERE_PATH, 'example/bear/00004.jpg'),
197
- os.path.join(HERE_PATH, 'example/bear/00005.jpg'),
198
- os.path.join(HERE_PATH, 'example/bear/00006.jpg'),
199
- os.path.join(HERE_PATH, 'example/bear/00007.jpg'),
200
- os.path.join(HERE_PATH, 'example/bear/00008.jpg'),
201
- os.path.join(HERE_PATH, 'example/bear/00009.jpg'),
202
  ]
203
  ],
204
  [
 
116
  depth = pipe(image)["predicted_depth"].numpy()
117
  depth = cv2.resize(depth[0], image.size, interpolation=cv2.INTER_LANCZOS4)
118
  focallength_px = 200
119
+ print(depth.max(),depth.min())
120
  depth_list.append(depth)
121
  focallength_px_list.append(focallength_px)
122
  #np.savez_compressed(path_depthanything, depth=depth)
 
139
  model = AsymmetricCroCo3DStereo.from_pretrained(weights_path).to(device)
140
  output = inference(pairs, model, device, batch_size=batch_size, verbose=not silent)
141
  mode = GlobalAlignerMode.PointCloudOptimizer
142
+ print(output)
143
  scene = global_aligner(output, device=device, mode=mode, verbose=not silent, shared_focal = True, temporal_smoothing_weight=0.01, translation_weight=1.0,
144
  flow_loss_weight=0.01, flow_loss_start_epoch=0.1, flow_loss_thre=25, use_self_mask=True,
145
  num_total_iter=300, empty_cache= len(filelist) > 72)
 
194
  [os.path.join(HERE_PATH, 'example/bear/00000.jpg'),
195
  os.path.join(HERE_PATH, 'example/bear/00001.jpg'),
196
  os.path.join(HERE_PATH, 'example/bear/00002.jpg'),
 
 
 
 
 
 
 
197
  ]
198
  ],
199
  [
croco/models/__pycache__/pos_embed.cpython-311.pyc CHANGED
Binary files a/croco/models/__pycache__/pos_embed.cpython-311.pyc and b/croco/models/__pycache__/pos_embed.cpython-311.pyc differ
 
third_party/RAFT/core/__pycache__/extractor.cpython-311.pyc CHANGED
Binary files a/third_party/RAFT/core/__pycache__/extractor.cpython-311.pyc and b/third_party/RAFT/core/__pycache__/extractor.cpython-311.pyc differ
 
third_party/RAFT/core/extractor.py CHANGED
@@ -312,7 +312,7 @@ class ResNetFPN(nn.Module):
312
  nn.init.constant_(m.weight, 1)
313
  if m.bias is not None:
314
  nn.init.constant_(m.bias, 0)
315
-
316
  if self.init_weight:
317
  from torchvision.models import resnet18, ResNet18_Weights, resnet34, ResNet34_Weights
318
  if args.pretrain == 'resnet18':
 
312
  nn.init.constant_(m.weight, 1)
313
  if m.bias is not None:
314
  nn.init.constant_(m.bias, 0)
315
+ #print('****',args.pretrain, self.init_weight)
316
  if self.init_weight:
317
  from torchvision.models import resnet18, ResNet18_Weights, resnet34, ResNet34_Weights
318
  if args.pretrain == 'resnet18':