mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-14 20:03:49 +08:00
Rename friends dataset to sitcoms3d (#1503)
* Rename friends dataset with official name sitcoms3d * Rename downloaded folder * Fix pylint
This commit is contained in:
1 parent
7dc7129cf8
commit
871eb0f7d3
5 files changed
+32
-24
No files matched your search
@@ -22,16 +22,16 @@ The transient embeddings are still under development. Please stay tuned.
|
||||
|
||||
### Running Model
|
||||
|
||||
Download the Friends Dataset
|
||||
Download the sitcoms3D Dataset
|
||||
|
||||
```bash
|
||||
ns-download-data friends
|
||||
ns-download-data sitcoms3d
|
||||
```
|
||||
|
||||
```bash
|
||||
ns-train semantic-nerfw
|
||||
```
|
||||
|
||||
This model defaults to using the "friends" dataset from the paper ["The One Where They Reconstructed 3D Humans and Environments in TV Shows"](https://ethanweber.me/sitcoms3D/).
|
||||
This model defaults to using the "sitcoms3D" dataset from the paper ["The One Where They Reconstructed 3D Humans and Environments in TV Shows"](https://ethanweber.me/sitcoms3D/).
|
||||
|
||||
<video src="https://ethanweber.me/sitcoms3D/media/trimmed_from_supplementary/sfm_and_nerf.mp4" width=300></video>
|
||||
@@ -34,7 +34,6 @@ from nerfstudio.data.datamanagers.variable_res_datamanager import (
|
||||
from nerfstudio.data.dataparsers.blender_dataparser import BlenderDataParserConfig
|
||||
from nerfstudio.data.dataparsers.dnerf_dataparser import DNeRFDataParserConfig
|
||||
from nerfstudio.data.dataparsers.dycheck_dataparser import DycheckDataParserConfig
|
||||
from nerfstudio.data.dataparsers.friends_dataparser import FriendsDataParserConfig
|
||||
from nerfstudio.data.dataparsers.instant_ngp_dataparser import (
|
||||
InstantNGPDataParserConfig,
|
||||
)
|
||||
@@ -42,6 +41,7 @@ from nerfstudio.data.dataparsers.nerfstudio_dataparser import NerfstudioDataPars
|
||||
from nerfstudio.data.dataparsers.phototourism_dataparser import (
|
||||
PhototourismDataParserConfig,
|
||||
)
|
||||
from nerfstudio.data.dataparsers.sitcoms3d_dataparser import Sitcoms3DDataParserConfig
|
||||
from nerfstudio.engine.optimizers import AdamOptimizerConfig, RAdamOptimizerConfig
|
||||
from nerfstudio.engine.schedulers import ExponentialDecaySchedulerConfig
|
||||
from nerfstudio.engine.trainer import TrainerConfig
|
||||
@@ -214,7 +214,7 @@ method_configs["semantic-nerfw"] = TrainerConfig(
|
||||
mixed_precision=True,
|
||||
pipeline=VanillaPipelineConfig(
|
||||
datamanager=SemanticDataManagerConfig(
|
||||
dataparser=FriendsDataParserConfig(), train_num_rays_per_batch=4096, eval_num_rays_per_batch=8192
|
||||
dataparser=Sitcoms3DDataParserConfig(), train_num_rays_per_batch=4096, eval_num_rays_per_batch=8192
|
||||
),
|
||||
model=SemanticNerfWModelConfig(eval_num_rays_per_chunk=1 << 16),
|
||||
),
|
||||
|
||||
@@ -39,7 +39,6 @@ from nerfstudio.data.dataparsers.base_dataparser import DataparserOutputs
|
||||
from nerfstudio.data.dataparsers.blender_dataparser import BlenderDataParserConfig
|
||||
from nerfstudio.data.dataparsers.dnerf_dataparser import DNeRFDataParserConfig
|
||||
from nerfstudio.data.dataparsers.dycheck_dataparser import DycheckDataParserConfig
|
||||
from nerfstudio.data.dataparsers.friends_dataparser import FriendsDataParserConfig
|
||||
from nerfstudio.data.dataparsers.instant_ngp_dataparser import (
|
||||
InstantNGPDataParserConfig,
|
||||
)
|
||||
@@ -50,6 +49,7 @@ from nerfstudio.data.dataparsers.phototourism_dataparser import (
|
||||
PhototourismDataParserConfig,
|
||||
)
|
||||
from nerfstudio.data.dataparsers.sdfstudio_dataparser import SDFStudioDataParserConfig
|
||||
from nerfstudio.data.dataparsers.sitcoms3d_dataparser import Sitcoms3DDataParserConfig
|
||||
from nerfstudio.data.datasets.base_dataset import InputDataset
|
||||
from nerfstudio.data.pixel_samplers import (
|
||||
EquirectangularPixelSampler,
|
||||
@@ -74,13 +74,13 @@ AnnotatedDataParserUnion = tyro.conf.OmitSubcommandPrefixes[ # Omit prefixes of
|
||||
"nerfstudio-data": NerfstudioDataParserConfig(),
|
||||
"minimal-parser": MinimalDataParserConfig(),
|
||||
"blender-data": BlenderDataParserConfig(),
|
||||
"friends-data": FriendsDataParserConfig(),
|
||||
"instant-ngp-data": InstantNGPDataParserConfig(),
|
||||
"nuscenes-data": NuScenesDataParserConfig(),
|
||||
"dnerf-data": DNeRFDataParserConfig(),
|
||||
"phototourism-data": PhototourismDataParserConfig(),
|
||||
"dycheck-data": DycheckDataParserConfig(),
|
||||
"sdfstudio-data": SDFStudioDataParserConfig(),
|
||||
"sitcoms3d-data": Sitcoms3DDataParserConfig(),
|
||||
},
|
||||
prefix_names=False, # Omit prefixes in subcommands themselves.
|
||||
)
|
||||
|
||||
+14
-9
@@ -12,7 +12,12 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""Data parser for friends dataset"""
|
||||
"""Data parser for sitcoms3D dataset.
|
||||
|
||||
The dataset is from the paper ["The One Where They Reconstructed 3D Humans and
|
||||
Environments in TV Shows"](https://ethanweber.me/sitcoms3D/)
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
@@ -36,12 +41,12 @@ CONSOLE = Console()
|
||||
|
||||
|
||||
@dataclass
|
||||
class FriendsDataParserConfig(DataParserConfig):
|
||||
"""Friends dataset parser config"""
|
||||
class Sitcoms3DDataParserConfig(DataParserConfig):
|
||||
"""sitcoms3D dataset parser config"""
|
||||
|
||||
_target: Type = field(default_factory=lambda: Friends)
|
||||
_target: Type = field(default_factory=lambda: Sitcoms3D)
|
||||
"""target class to instantiate"""
|
||||
data: Path = Path("data/friends/TBBT-big_living_room")
|
||||
data: Path = Path("data/sitcoms3d/TBBT-big_living_room")
|
||||
"""Directory specifying location of data."""
|
||||
include_semantics: bool = True
|
||||
"""whether or not to include loading of semantics data"""
|
||||
@@ -49,15 +54,15 @@ class FriendsDataParserConfig(DataParserConfig):
|
||||
scene_scale: float = 2.0
|
||||
"""
|
||||
Sets the bounding cube to have edge length of this size.
|
||||
The longest dimension of the Friends axis-aligned bbox will be scaled to this value.
|
||||
The longest dimension of the Sitcoms3D axis-aligned bbox will be scaled to this value.
|
||||
"""
|
||||
|
||||
|
||||
@dataclass
|
||||
class Friends(DataParser):
|
||||
"""Friends Dataset"""
|
||||
class Sitcoms3D(DataParser):
|
||||
"""Sitcoms3D Dataset"""
|
||||
|
||||
config: FriendsDataParserConfig
|
||||
config: Sitcoms3DDataParserConfig
|
||||
|
||||
def _generate_dataparser_outputs(self, split="train"): # pylint: disable=unused-argument,too-many-statements
|
||||
|
||||
@@ -62,22 +62,25 @@ class BlenderDownload(DatasetDownload):
|
||||
|
||||
|
||||
@dataclass
|
||||
class FriendsDownload(DatasetDownload):
|
||||
"""Download the friends dataset."""
|
||||
class Sitcoms3DDownload(DatasetDownload):
|
||||
"""Download the sitcoms3D dataset."""
|
||||
|
||||
def download(self, save_dir: Path):
|
||||
"""Download the friends dataset."""
|
||||
"""Download the sitcoms3D dataset."""
|
||||
|
||||
# https://drive.google.com/file/d/1sgKr0ZO7BQC0FYinAnRSxobIWNucAST5/view?usp=sharing
|
||||
friends_file_id = "1sgKr0ZO7BQC0FYinAnRSxobIWNucAST5"
|
||||
sitcoms3d_file_id = "1sgKr0ZO7BQC0FYinAnRSxobIWNucAST5"
|
||||
|
||||
# Download the files
|
||||
url = f"https://drive.google.com/uc?id={friends_file_id}"
|
||||
download_path = str(save_dir / "friends.zip")
|
||||
url = f"https://drive.google.com/uc?id={sitcoms3d_file_id}"
|
||||
download_path = str(save_dir / "sitcoms3d.zip")
|
||||
gdown.download(url, output=download_path)
|
||||
with zipfile.ZipFile(download_path, "r") as zip_ref:
|
||||
zip_ref.extractall(str(save_dir))
|
||||
os.remove(download_path)
|
||||
# The folder name of the downloaded dataset is the previously using 'friends/'
|
||||
if os.path.exists(str(save_dir / "friends/")):
|
||||
os.rename(str(save_dir / "friends/"), str(save_dir / "sitcoms3d/"))
|
||||
|
||||
|
||||
def grab_file_id(zip_url: str) -> str:
|
||||
@@ -358,7 +361,7 @@ class SDFstudioDemoDownload(DatasetDownload):
|
||||
|
||||
Commands = Union[
|
||||
Annotated[BlenderDownload, tyro.conf.subcommand(name="blender")],
|
||||
Annotated[FriendsDownload, tyro.conf.subcommand(name="friends")],
|
||||
Annotated[Sitcoms3DDownload, tyro.conf.subcommand(name="sitcoms3d")],
|
||||
Annotated[NerfstudioDownload, tyro.conf.subcommand(name="nerfstudio")],
|
||||
Annotated[Record3dDownload, tyro.conf.subcommand(name="record3d")],
|
||||
Annotated[DNerfDownload, tyro.conf.subcommand(name="dnerf")],
|
||||
@@ -375,7 +378,7 @@ def main(
|
||||
- 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.
|
||||
- friends: Friends TV show scenes.
|
||||
- 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.
|
||||
|
||||
Reference in new issue
Block a user