mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-30 12:59:40 +08:00
SFM: sfm-based depth, some breadcrumbs for pycolmap (#1457)
* save * save * more cleanup * save * save * update phototourism * save * works * works * cleanup * cleanup * lint * python3 default * cleanup
This commit is contained in:
1 parent
b62571d537
commit
5c73766653
19 files changed
+621
-469
No files matched your search
@@ -31,7 +31,7 @@ def apply_colormap(image: TensorType["bs":..., 1], cmap="viridis") -> TensorType
|
||||
cmap: Colormap for image.
|
||||
|
||||
Returns:
|
||||
TensorType: Colored image
|
||||
TensorType: Colored image with colors in [0, 1]
|
||||
"""
|
||||
|
||||
colormap = cm.get_cmap(cmap)
|
||||
@@ -62,7 +62,7 @@ def apply_depth_colormap(
|
||||
cmap: Colormap to apply.
|
||||
|
||||
Returns:
|
||||
Colored depth image
|
||||
Colored depth image with colors in [0, 1]
|
||||
"""
|
||||
|
||||
near_plane = near_plane or float(torch.min(depth))
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
Miscellaneous helper code.
|
||||
"""
|
||||
|
||||
|
||||
from typing import Any, Callable, Dict, List, Optional, Union
|
||||
|
||||
import torch
|
||||
@@ -147,3 +148,10 @@ def update_avg(prev_avg: float, new_val: float, step: int) -> float:
|
||||
float: new updated average
|
||||
"""
|
||||
return (step * prev_avg + new_val) / (step + 1)
|
||||
|
||||
|
||||
def strtobool(val) -> bool:
|
||||
"""Cheap replacement for `distutils.util.strtobool()` which is deprecated
|
||||
FMI https://stackoverflow.com/a/715468
|
||||
"""
|
||||
return val.lower() in ("yes", "y", "true", "t", "on", "1")
|
||||
Reference in new issue
Block a user