init project
Browse files
app.py
CHANGED
|
@@ -256,7 +256,7 @@ def slerp_multiple(vectors, t_values):
|
|
| 256 |
|
| 257 |
return interpolated_vector
|
| 258 |
|
| 259 |
-
@torch.no_grad
|
| 260 |
def get_mask_from_img_sam1(sam1_image, yolov8_image, original_size, input_size, transform):
|
| 261 |
|
| 262 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
|
@@ -326,7 +326,7 @@ def get_mask_from_img_sam1(sam1_image, yolov8_image, original_size, input_size,
|
|
| 326 |
|
| 327 |
return ret_mask
|
| 328 |
|
| 329 |
-
@torch.no_grad
|
| 330 |
def get_cog_feats(images):
|
| 331 |
|
| 332 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
|
@@ -540,7 +540,7 @@ def get_reconstructed_scene(outdir, filelist, schedule, niter, min_conf_thr,
|
|
| 540 |
outfile = get_3D_model_from_scene(outdir, scene, min_conf_thr, as_pointcloud, mask_sky,
|
| 541 |
clean_depth, transparent_cams, cam_size)
|
| 542 |
|
| 543 |
-
|
| 544 |
torch.cuda.empty_cache()
|
| 545 |
|
| 546 |
return scene, outfile
|
|
|
|
| 256 |
|
| 257 |
return interpolated_vector
|
| 258 |
|
| 259 |
+
# @torch.no_grad
|
| 260 |
def get_mask_from_img_sam1(sam1_image, yolov8_image, original_size, input_size, transform):
|
| 261 |
|
| 262 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
|
|
|
| 326 |
|
| 327 |
return ret_mask
|
| 328 |
|
| 329 |
+
# @torch.no_grad
|
| 330 |
def get_cog_feats(images):
|
| 331 |
|
| 332 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
|
|
|
| 540 |
outfile = get_3D_model_from_scene(outdir, scene, min_conf_thr, as_pointcloud, mask_sky,
|
| 541 |
clean_depth, transparent_cams, cam_size)
|
| 542 |
|
| 543 |
+
scene.to('cpu')
|
| 544 |
torch.cuda.empty_cache()
|
| 545 |
|
| 546 |
return scene, outfile
|