Merge branch 'main' of https://github.com/nerfstudio-project/nerfstudio into terrance/dreamembedding

This commit is contained in:
terrancewang committed 2023-03-14 18:01:39 -07:00
commit dc5985bfc5
37 files changed
+1965 -192

No files matched your search

+9 -2
View File
@@ -55,6 +55,8 @@ class ProcessImages:
sfm_tool: Literal["any", "colmap", "hloc"] = "any"
"""Structure from motion tool to use. Colmap will use sift features, hloc can use many modern methods
such as superpoint features and superglue matcher"""
refine_pixsfm: bool = False
"""If True, runs refinement using Pixel Perfect SFM. Only works with hloc sfm_tool"""
feature_type: Literal[
"any",
"sift",
@@ -89,6 +91,8 @@ class ProcessImages:
"""Number of samples per image to take from each equirectangular image.
Used only when camera-type is equirectangular.
"""
crop_factor: Tuple[float, float, float, float] = (0.0, 0.0, 0.0, 0.0)
"""Portion of the image to crop. All values should be in [0,1]. (top, bottom, left, right)"""
gpu: bool = True
"""If True, use GPU."""
use_sfm_depth: bool = False
@@ -127,7 +131,7 @@ class ProcessImages:
pers_size = equirect_utils.compute_resolution_from_equirect(self.data, self.images_per_equirect)
CONSOLE.log(f"Generating {self.images_per_equirect} {pers_size} sized images per equirectangular image")
self.data = equirect_utils.generate_planar_projections_from_equirectangular(
self.data, pers_size, self.images_per_equirect
self.data, pers_size, self.images_per_equirect, crop_factor=self.crop_factor
)
summary_log = []
@@ -136,7 +140,7 @@ class ProcessImages:
if not self.skip_image_processing:
# Copy images to output directory
image_rename_map_paths = process_data_utils.copy_images(
self.data, image_dir=image_dir, verbose=self.verbose
self.data, image_dir=image_dir, crop_factor=self.crop_factor, verbose=self.verbose
)
image_rename_map = dict((a.name, b.name) for a, b in image_rename_map_paths.items())
num_frames = len(image_rename_map)
@@ -211,6 +215,9 @@ class ProcessImages:
(sfm_tool, feature_type, matcher_type) = process_data_utils.find_tool_feature_matcher_combination(
self.sfm_tool, self.feature_type, self.matcher_type
)
# check that sfm_tool is hloc if using refine_pixsfm
if self.refine_pixsfm:
assert sfm_tool == "hloc", "refine_pixsfm only works with sfm_tool hloc"
if sfm_tool == "colmap":
colmap_utils.run_colmap(