Added docs wording change and also --crop-bottom (#1767)

* added docs wording change and also --crop-bottom

* fixed linting
This commit is contained in:
Rohan Mathur authored and GitHub committed 2023-04-20 09:58:02 -07:00
1 parent 8d9c4005d4
commit bf3ae6ac5c
2 files changed
+17 -1

No files matched your search

+3 -1
View File
@@ -341,4 +341,6 @@ The `crop-factor` argument is optional but often very helpful. This is because e
<img src="imgs/equirect_crop.jpg">
This obscene mesh of human is obviously not helpful in training a nerf so we can remove it by cropping the bottom 20% of the image. This can be done by using the `--crop-factor 0 0.2 0 0` argument.
The pixels representing the distorted hand and head are obviously not useful in training a nerf so we can remove it by cropping the bottom 20% of the image. This can be done by using the `--crop-factor 0 0.2 0 0` argument.
If cropping only needs to be done from the bottom, you can use the `--crop-bottom [num]` argument which would be the same as doing `--crop-factor 0.0 [num] 0.0 0.0`
+14
View File
@@ -91,6 +91,10 @@ class ProcessImages:
"""
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)"""
crop_bottom: float = 0.0
"""Portion of the image to crop from the bottom.
Can be used instead of `crop-factor 0.0 [num] 0.0 0.0` Should be in [0,1].
"""
gpu: bool = True
"""If True, use GPU."""
use_sfm_depth: bool = False
@@ -124,6 +128,9 @@ class ProcessImages:
image_dir = self.output_dir / "images"
image_dir.mkdir(parents=True, exist_ok=True)
if self.crop_bottom > 0.0:
self.crop_factor = (0.0, self.crop_bottom, 0.0, 0.0)
# Generate planar projections if equirectangular
if self.camera_type == "equirectangular":
pers_size = equirect_utils.compute_resolution_from_equirect(self.data, self.images_per_equirect)
@@ -302,6 +309,10 @@ class ProcessVideo:
"""Create circle crop mask. The radius is the percent of the image diagonal."""
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)"""
crop_bottom: float = 0.0
"""Portion of the image to crop from the bottom.
Can be used instead of `crop-factor 0.0 [num] 0.0 0.0` Should be in [0,1].
"""
use_sfm_depth: bool = False
"""If True, export and use depth maps induced from SfM points."""
include_depth_debug: bool = False
@@ -320,6 +331,9 @@ class ProcessVideo:
image_dir = self.output_dir / "images"
image_dir.mkdir(parents=True, exist_ok=True)
if self.crop_bottom > 0.0:
self.crop_factor = (0.0, self.crop_bottom, 0.0, 0.0)
summary_log = []
# Convert video to images
if self.camera_type == "equirectangular":