mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-03 14:28:41 +08:00
Update dependencies for M1 Macs (#2665)
* Update dependencies for M1 Macs * import newrawpy as rawpy * Comment * Add back rawpy for Linux * Run black
This commit is contained in:
1 parent
390b63373d
commit
73fc3dcd63
2 files changed
+25
-7
No files matched your search
@@ -24,9 +24,13 @@ from typing import List, Literal, Optional, OrderedDict, Tuple, Union
|
|||||||
|
|
||||||
import cv2
|
import cv2
|
||||||
import imageio
|
import imageio
|
||||||
import numpy as np
|
|
||||||
import rawpy
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
import rawpy
|
||||||
|
except ImportError:
|
||||||
|
import newrawpy as rawpy # type: ignore
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
from nerfstudio.utils.rich_utils import CONSOLE, status
|
from nerfstudio.utils.rich_utils import CONSOLE, status
|
||||||
from nerfstudio.utils.scripts import run_command
|
from nerfstudio.utils.scripts import run_command
|
||||||
|
|
||||||
@@ -352,7 +356,11 @@ def copy_and_upscale_polycam_depth_maps_list(
|
|||||||
depth_dir.mkdir(parents=True, exist_ok=True)
|
depth_dir.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
# copy and upscale them to new directory
|
# copy and upscale them to new directory
|
||||||
with status(msg="[bold yellow] Upscaling depth maps...", spinner="growVertical", verbose=verbose):
|
with status(
|
||||||
|
msg="[bold yellow] Upscaling depth maps...",
|
||||||
|
spinner="growVertical",
|
||||||
|
verbose=verbose,
|
||||||
|
):
|
||||||
upscale_factor = 2**POLYCAM_UPSCALING_TIMES
|
upscale_factor = 2**POLYCAM_UPSCALING_TIMES
|
||||||
assert upscale_factor > 1
|
assert upscale_factor > 1
|
||||||
assert isinstance(upscale_factor, int)
|
assert isinstance(upscale_factor, int)
|
||||||
@@ -437,7 +445,11 @@ def downscale_images(
|
|||||||
if num_downscales == 0:
|
if num_downscales == 0:
|
||||||
return "No downscaling performed."
|
return "No downscaling performed."
|
||||||
|
|
||||||
with status(msg="[bold yellow]Downscaling images...", spinner="growVertical", verbose=verbose):
|
with status(
|
||||||
|
msg="[bold yellow]Downscaling images...",
|
||||||
|
spinner="growVertical",
|
||||||
|
verbose=verbose,
|
||||||
|
):
|
||||||
downscale_factors = [2**i for i in range(num_downscales + 1)[1:]]
|
downscale_factors = [2**i for i in range(num_downscales + 1)[1:]]
|
||||||
for downscale_factor in downscale_factors:
|
for downscale_factor in downscale_factors:
|
||||||
assert downscale_factor > 1
|
assert downscale_factor > 1
|
||||||
@@ -600,7 +612,10 @@ def generate_crop_mask(height: int, width: int, crop_factor: Tuple[float, float,
|
|||||||
|
|
||||||
|
|
||||||
def generate_mask(
|
def generate_mask(
|
||||||
height: int, width: int, crop_factor: Tuple[float, float, float, float], percent_radius: float
|
height: int,
|
||||||
|
width: int,
|
||||||
|
crop_factor: Tuple[float, float, float, float],
|
||||||
|
percent_radius: float,
|
||||||
) -> Optional[np.ndarray]:
|
) -> Optional[np.ndarray]:
|
||||||
"""generate a mask of the given size.
|
"""generate a mask of the given size.
|
||||||
|
|
||||||
|
|||||||
+5
-2
@@ -39,11 +39,14 @@ dependencies = [
|
|||||||
"protobuf<=3.20.3,!=3.20.0",
|
"protobuf<=3.20.3,!=3.20.0",
|
||||||
# TODO(1480) enable when pycolmap windows wheels are available
|
# TODO(1480) enable when pycolmap windows wheels are available
|
||||||
# "pycolmap==0.3.0",
|
# "pycolmap==0.3.0",
|
||||||
"pymeshlab>=2022.2.post2",
|
"pymeshlab>=2022.2.post2; platform_machine != 'arm64'",
|
||||||
"pyngrok>=5.1.0",
|
"pyngrok>=5.1.0",
|
||||||
"python-socketio>=5.7.1",
|
"python-socketio>=5.7.1",
|
||||||
"pyquaternion>=0.9.9",
|
"pyquaternion>=0.9.9",
|
||||||
"rawpy>=0.18.1",
|
# TODO we can switch back to (non-new) rawpy if they start releasing arm64
|
||||||
|
# wheels. https://github.com/letmaik/rawpy/issues/171#issuecomment-1572627747
|
||||||
|
"rawpy>=0.18.1; platform_machine != 'arm64'",
|
||||||
|
"newrawpy>=0.18.1; platform_machine == 'arm64'",
|
||||||
"requests",
|
"requests",
|
||||||
"rich>=12.5.1",
|
"rich>=12.5.1",
|
||||||
"scikit-image>=0.19.3",
|
"scikit-image>=0.19.3",
|
||||||
|
|||||||
Reference in new issue
Block a user