Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add preliminary EyefulTower dataset support #2672

Merged
merged 25 commits into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2158946
Add ability to download EyefulTower dataset
VasuAgrawal Dec 7, 2023
ba5ce12
wip before I copy linning's stuff in
VasuAgrawal Dec 8, 2023
f95b4eb
Generate per-resolution cameras.xml
VasuAgrawal Dec 9, 2023
f811bd2
Generate transforms.json at download
VasuAgrawal Dec 12, 2023
59e1cf6
Fix a couple of quotes
VasuAgrawal Jan 10, 2024
688c39b
Use official EyefulTower splits for train and val
VasuAgrawal Jan 10, 2024
25b6d58
Disable projectaria-tools on windows
VasuAgrawal Jan 11, 2024
0e7d29e
Fix extra imports
VasuAgrawal Jan 11, 2024
5393ee4
Add a new nerfacto method tund for EyefulTower
VasuAgrawal Jan 11, 2024
8fb0a8b
Split eyefultower download into a separate file
VasuAgrawal Jan 12, 2024
88c644a
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstud…
VasuAgrawal Jan 16, 2024
ac5200a
Add some fisheye support for eyeful data
VasuAgrawal Jan 16, 2024
6998760
Reformatted imports to not be dumb
VasuAgrawal Jan 16, 2024
82d4f5e
Apparently this file was missed when formatting originally
VasuAgrawal Jan 16, 2024
bf6d7b7
Added 1k resolution scenes
VasuAgrawal Jan 18, 2024
7126694
revert method_configs.py to original values
VasuAgrawal Jan 18, 2024
e24ffe0
Also add 1k exrs
VasuAgrawal Jan 18, 2024
44581bf
Address feedback
VasuAgrawal Jan 19, 2024
544cb81
Revert changes to pyproject.toml, to be added in a later PR
VasuAgrawal Jan 19, 2024
59333c9
Merge branch 'main' of https://github.com/nerfstudio-project/nerfstud…
VasuAgrawal Jan 19, 2024
d1abe18
Oops, probably shouldn't have gotten rid of awscli ...
VasuAgrawal Jan 19, 2024
a791591
merged main
ethanweber Jan 19, 2024
cdd1d15
changed glob variable name
ethanweber Jan 19, 2024
df75237
Update tensor_dataclass.py
brentyi Jan 20, 2024
861b9a7
Merge branch 'main' into convert-cameras-json
brentyi Jan 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions nerfstudio/data/datamanagers/base_datamanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,8 @@ def _get_pixel_sampler(self, dataset: TDataset, num_rays_per_batch: int) -> Pixe
CONSOLE.print("[bold yellow]Warning: Some cameras are equirectangular, but using default pixel sampler.")

fisheye_crop_radius = None
if dataset.cameras.metadata is not None and "fisheye_crop_radius" in dataset.cameras.metadata:
fisheye_crop_radius = dataset.cameras.metadata["fisheye_crop_radius"]
if dataset.cameras.metadata is not None:
fisheye_crop_radius = dataset.cameras.metadata.get("fisheye_crop_radius")

return self.config.pixel_sampler.setup(
is_equirectangular=is_equirectangular,
Expand Down
9 changes: 8 additions & 1 deletion nerfstudio/data/datamanagers/parallel_datamanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,15 @@ def _get_pixel_sampler(self, dataset: TDataset, num_rays_per_batch: int) -> Pixe
is_equirectangular = (dataset.cameras.camera_type == CameraType.EQUIRECTANGULAR.value).all()
if is_equirectangular.any():
CONSOLE.print("[bold yellow]Warning: Some cameras are equirectangular, but using default pixel sampler.")

fisheye_crop_radius = None
if dataset.cameras.metadata is not None:
fisheye_crop_radius = dataset.cameras.metadata.get("fisheye_crop_radius")

return self.config.pixel_sampler.setup(
is_equirectangular=is_equirectangular, num_rays_per_batch=num_rays_per_batch
is_equirectangular=is_equirectangular,
num_rays_per_batch=num_rays_per_batch,
fisheye_crop_radius=fisheye_crop_radius,
)

def setup_train(self):
Expand Down
7 changes: 6 additions & 1 deletion nerfstudio/data/dataparsers/nerfstudio_dataparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,12 @@ def _generate_dataparser_outputs(self, split="train"):
else:
distortion_params = torch.stack(distort, dim=0)[idx_tensor]

metadata = {"fisheye_crop_radius": fisheye_crop_radius} if fisheye_crop_radius is not None else None
# Only add fisheye crop radius parameter if the images are actually fisheye, to allow the same config to be used
# for both fisheye and non-fisheye datasets.
metadata = {}
if (camera_type in [CameraType.FISHEYE, CameraType.FISHEYE624]) and (fisheye_crop_radius is not None):
metadata["fisheye_crop_radius"] = fisheye_crop_radius

cameras = Cameras(
fx=fx,
fy=fy,
Expand Down
6 changes: 4 additions & 2 deletions nerfstudio/process_data/process_data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,18 @@ class CameraModel(Enum):
}


def list_images(data: Path) -> List[Path]:
def list_images(data: Path, recursive: bool = False) -> List[Path]:
"""Lists all supported images in a directory

Args:
data: Path to the directory of images.
recursive: Whether to search check nested folders in `data`.
Returns:
Paths to images contained in the directory
"""
allowed_exts = [".jpg", ".jpeg", ".png", ".tif", ".tiff"] + ALLOWED_RAW_EXTS
image_paths = sorted([p for p in data.glob("[!.]*") if p.suffix.lower() in allowed_exts])
glob = "**/[!.]*" if recursive else "[!.]*"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT but can you rename this to glob_str in case someone imports glob in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you got it, thanks!

image_paths = sorted([p for p in data.glob(glob) if p.suffix.lower() in allowed_exts])
return image_paths


Expand Down
28 changes: 4 additions & 24 deletions nerfstudio/scripts/downloads/download_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,13 @@
import tyro
from typing_extensions import Annotated

from nerfstudio.configs.base_config import PrintableConfig
from nerfstudio.process_data import process_data_utils
from nerfstudio.scripts.downloads.eyeful_tower import EyefulTowerDownload
from nerfstudio.scripts.downloads.utils import DatasetDownload
from nerfstudio.utils import install_checks
from nerfstudio.utils.scripts import run_command


@dataclass
class DatasetDownload(PrintableConfig):
"""Download a dataset"""

capture_name = None

save_dir: Path = Path("data/")
"""The directory to save the dataset to"""

def download(self, save_dir: Path) -> None:
"""Download the dataset"""
raise NotImplementedError


@dataclass
class BlenderDownload(DatasetDownload):
"""Download the blender dataset."""
Expand Down Expand Up @@ -555,22 +542,15 @@ def download(self, save_dir: Path) -> None:
Annotated[SDFstudioDemoDownload, tyro.conf.subcommand(name="sdfstudio")],
Annotated[NeRFOSRDownload, tyro.conf.subcommand(name="nerfosr")],
Annotated[Mill19Download, tyro.conf.subcommand(name="mill19")],
Annotated[EyefulTowerDownload, tyro.conf.subcommand(name="eyefultower")],
]


def main(
dataset: DatasetDownload,
):
"""Script to download existing datasets.
We currently support the following datasets:
- nerfstudio: Growing collection of real-world scenes. Use the `capture_name` argument to specify
which capture to download.
- blender: Blender synthetic scenes realeased with NeRF.
- sitcoms3d: Friends TV show scenes.
- record3d: Record3d dataset.
- dnerf: D-NeRF dataset.
- phototourism: PhotoTourism dataset. Use the `capture_name` argument to specify which capture to download.
- mill19: Mill 19 dataset. Use the `capture_name` argument to specify which capture to download.
We currently support the datasets listed above in the Commands.
ethanweber marked this conversation as resolved.
Show resolved Hide resolved

Args:
dataset: The dataset to download (from).
Expand Down
Loading
Loading