Commit 38afdcfc authored by generatedunixname89002005307016's avatar generatedunixname89002005307016 Committed by Facebook GitHub Bot
Browse files

upgrade pyre version in `fbcode/vision` - batch 2

Reviewed By: bottler

Differential Revision: D60992234

fbshipit-source-id: 899db6ed590ef966ff651c11027819e59b8401a3
parent 1e0b1d9c
...@@ -99,7 +99,7 @@ except ModuleNotFoundError: ...@@ -99,7 +99,7 @@ except ModuleNotFoundError:
no_accelerate = os.environ.get("PYTORCH3D_NO_ACCELERATE") is not None no_accelerate = os.environ.get("PYTORCH3D_NO_ACCELERATE") is not None
class Experiment(Configurable): # pyre-ignore: 13 class Experiment(Configurable):
""" """
This class is at the top level of Implicitron's config hierarchy. Its This class is at the top level of Implicitron's config hierarchy. Its
members are high-level components necessary for training an implicit rende- members are high-level components necessary for training an implicit rende-
...@@ -120,12 +120,16 @@ class Experiment(Configurable): # pyre-ignore: 13 ...@@ -120,12 +120,16 @@ class Experiment(Configurable): # pyre-ignore: 13
will be saved here. will be saved here.
""" """
# pyre-fixme[13]: Attribute `data_source` is never initialized.
data_source: DataSourceBase data_source: DataSourceBase
data_source_class_type: str = "ImplicitronDataSource" data_source_class_type: str = "ImplicitronDataSource"
# pyre-fixme[13]: Attribute `model_factory` is never initialized.
model_factory: ModelFactoryBase model_factory: ModelFactoryBase
model_factory_class_type: str = "ImplicitronModelFactory" model_factory_class_type: str = "ImplicitronModelFactory"
# pyre-fixme[13]: Attribute `optimizer_factory` is never initialized.
optimizer_factory: OptimizerFactoryBase optimizer_factory: OptimizerFactoryBase
optimizer_factory_class_type: str = "ImplicitronOptimizerFactory" optimizer_factory_class_type: str = "ImplicitronOptimizerFactory"
# pyre-fixme[13]: Attribute `training_loop` is never initialized.
training_loop: TrainingLoopBase training_loop: TrainingLoopBase
training_loop_class_type: str = "ImplicitronTrainingLoop" training_loop_class_type: str = "ImplicitronTrainingLoop"
......
...@@ -45,7 +45,7 @@ class ModelFactoryBase(ReplaceableBase): ...@@ -45,7 +45,7 @@ class ModelFactoryBase(ReplaceableBase):
@registry.register @registry.register
class ImplicitronModelFactory(ModelFactoryBase): # pyre-ignore [13] class ImplicitronModelFactory(ModelFactoryBase):
""" """
A factory class that initializes an implicit rendering model. A factory class that initializes an implicit rendering model.
...@@ -61,6 +61,7 @@ class ImplicitronModelFactory(ModelFactoryBase): # pyre-ignore [13] ...@@ -61,6 +61,7 @@ class ImplicitronModelFactory(ModelFactoryBase): # pyre-ignore [13]
""" """
# pyre-fixme[13]: Attribute `model` is never initialized.
model: ImplicitronModelBase model: ImplicitronModelBase
model_class_type: str = "GenericModel" model_class_type: str = "GenericModel"
resume: bool = True resume: bool = True
......
...@@ -30,13 +30,13 @@ from .utils import seed_all_random_engines ...@@ -30,13 +30,13 @@ from .utils import seed_all_random_engines
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
# pyre-fixme[13]: Attribute `evaluator` is never initialized.
class TrainingLoopBase(ReplaceableBase): class TrainingLoopBase(ReplaceableBase):
""" """
Members: Members:
evaluator: An EvaluatorBase instance, used to evaluate training results. evaluator: An EvaluatorBase instance, used to evaluate training results.
""" """
# pyre-fixme[13]: Attribute `evaluator` is never initialized.
evaluator: Optional[EvaluatorBase] evaluator: Optional[EvaluatorBase]
evaluator_class_type: Optional[str] = "ImplicitronEvaluator" evaluator_class_type: Optional[str] = "ImplicitronEvaluator"
......
...@@ -41,7 +41,7 @@ class DataSourceBase(ReplaceableBase): ...@@ -41,7 +41,7 @@ class DataSourceBase(ReplaceableBase):
@registry.register @registry.register
class ImplicitronDataSource(DataSourceBase): # pyre-ignore[13] class ImplicitronDataSource(DataSourceBase):
""" """
Represents the data used in Implicitron. This is the only implementation Represents the data used in Implicitron. This is the only implementation
of DataSourceBase provided. of DataSourceBase provided.
...@@ -52,8 +52,11 @@ class ImplicitronDataSource(DataSourceBase): # pyre-ignore[13] ...@@ -52,8 +52,11 @@ class ImplicitronDataSource(DataSourceBase): # pyre-ignore[13]
data_loader_map_provider_class_type: identifies type for data_loader_map_provider. data_loader_map_provider_class_type: identifies type for data_loader_map_provider.
""" """
# pyre-fixme[13]: Attribute `dataset_map_provider` is never initialized.
dataset_map_provider: DatasetMapProviderBase dataset_map_provider: DatasetMapProviderBase
# pyre-fixme[13]: Attribute `dataset_map_provider_class_type` is never initialized.
dataset_map_provider_class_type: str dataset_map_provider_class_type: str
# pyre-fixme[13]: Attribute `data_loader_map_provider` is never initialized.
data_loader_map_provider: DataLoaderMapProviderBase data_loader_map_provider: DataLoaderMapProviderBase
data_loader_map_provider_class_type: str = "SequenceDataLoaderMapProvider" data_loader_map_provider_class_type: str = "SequenceDataLoaderMapProvider"
......
...@@ -66,7 +66,7 @@ _NEED_CONTROL: Tuple[str, ...] = ( ...@@ -66,7 +66,7 @@ _NEED_CONTROL: Tuple[str, ...] = (
@registry.register @registry.register
class JsonIndexDatasetMapProvider(DatasetMapProviderBase): # pyre-ignore [13] class JsonIndexDatasetMapProvider(DatasetMapProviderBase):
""" """
Generates the training / validation and testing dataset objects for Generates the training / validation and testing dataset objects for
a dataset laid out on disk like Co3D, with annotations in json files. a dataset laid out on disk like Co3D, with annotations in json files.
...@@ -95,6 +95,7 @@ class JsonIndexDatasetMapProvider(DatasetMapProviderBase): # pyre-ignore [13] ...@@ -95,6 +95,7 @@ class JsonIndexDatasetMapProvider(DatasetMapProviderBase): # pyre-ignore [13]
path_manager_factory_class_type: The class type of `path_manager_factory`. path_manager_factory_class_type: The class type of `path_manager_factory`.
""" """
# pyre-fixme[13]: Attribute `category` is never initialized.
category: str category: str
task_str: str = "singlesequence" task_str: str = "singlesequence"
dataset_root: str = _CO3D_DATASET_ROOT dataset_root: str = _CO3D_DATASET_ROOT
...@@ -104,8 +105,10 @@ class JsonIndexDatasetMapProvider(DatasetMapProviderBase): # pyre-ignore [13] ...@@ -104,8 +105,10 @@ class JsonIndexDatasetMapProvider(DatasetMapProviderBase): # pyre-ignore [13]
test_restrict_sequence_id: int = -1 test_restrict_sequence_id: int = -1
assert_single_seq: bool = False assert_single_seq: bool = False
only_test_set: bool = False only_test_set: bool = False
# pyre-fixme[13]: Attribute `dataset` is never initialized.
dataset: JsonIndexDataset dataset: JsonIndexDataset
dataset_class_type: str = "JsonIndexDataset" dataset_class_type: str = "JsonIndexDataset"
# pyre-fixme[13]: Attribute `path_manager_factory` is never initialized.
path_manager_factory: PathManagerFactory path_manager_factory: PathManagerFactory
path_manager_factory_class_type: str = "PathManagerFactory" path_manager_factory_class_type: str = "PathManagerFactory"
......
...@@ -56,7 +56,7 @@ logger = logging.getLogger(__name__) ...@@ -56,7 +56,7 @@ logger = logging.getLogger(__name__)
@registry.register @registry.register
class JsonIndexDatasetMapProviderV2(DatasetMapProviderBase): # pyre-ignore [13] class JsonIndexDatasetMapProviderV2(DatasetMapProviderBase):
""" """
Generates the training, validation, and testing dataset objects for Generates the training, validation, and testing dataset objects for
a dataset laid out on disk like CO3Dv2, with annotations in gzipped json files. a dataset laid out on disk like CO3Dv2, with annotations in gzipped json files.
...@@ -171,7 +171,9 @@ class JsonIndexDatasetMapProviderV2(DatasetMapProviderBase): # pyre-ignore [13] ...@@ -171,7 +171,9 @@ class JsonIndexDatasetMapProviderV2(DatasetMapProviderBase): # pyre-ignore [13]
path_manager_factory_class_type: The class type of `path_manager_factory`. path_manager_factory_class_type: The class type of `path_manager_factory`.
""" """
# pyre-fixme[13]: Attribute `category` is never initialized.
category: str category: str
# pyre-fixme[13]: Attribute `subset_name` is never initialized.
subset_name: str subset_name: str
dataset_root: str = _CO3DV2_DATASET_ROOT dataset_root: str = _CO3DV2_DATASET_ROOT
...@@ -183,8 +185,10 @@ class JsonIndexDatasetMapProviderV2(DatasetMapProviderBase): # pyre-ignore [13] ...@@ -183,8 +185,10 @@ class JsonIndexDatasetMapProviderV2(DatasetMapProviderBase): # pyre-ignore [13]
n_known_frames_for_test: int = 0 n_known_frames_for_test: int = 0
dataset_class_type: str = "JsonIndexDataset" dataset_class_type: str = "JsonIndexDataset"
# pyre-fixme[13]: Attribute `dataset` is never initialized.
dataset: JsonIndexDataset dataset: JsonIndexDataset
# pyre-fixme[13]: Attribute `path_manager_factory` is never initialized.
path_manager_factory: PathManagerFactory path_manager_factory: PathManagerFactory
path_manager_factory_class_type: str = "PathManagerFactory" path_manager_factory_class_type: str = "PathManagerFactory"
......
...@@ -32,7 +32,7 @@ from .utils import DATASET_TYPE_KNOWN ...@@ -32,7 +32,7 @@ from .utils import DATASET_TYPE_KNOWN
@registry.register @registry.register
class RenderedMeshDatasetMapProvider(DatasetMapProviderBase): # pyre-ignore [13] class RenderedMeshDatasetMapProvider(DatasetMapProviderBase):
""" """
A simple single-scene dataset based on PyTorch3D renders of a mesh. A simple single-scene dataset based on PyTorch3D renders of a mesh.
Provides `num_views` renders of the mesh as train, with no val Provides `num_views` renders of the mesh as train, with no val
...@@ -76,6 +76,7 @@ class RenderedMeshDatasetMapProvider(DatasetMapProviderBase): # pyre-ignore [13 ...@@ -76,6 +76,7 @@ class RenderedMeshDatasetMapProvider(DatasetMapProviderBase): # pyre-ignore [13
resolution: int = 128 resolution: int = 128
use_point_light: bool = True use_point_light: bool = True
gpu_idx: Optional[int] = 0 gpu_idx: Optional[int] = 0
# pyre-fixme[13]: Attribute `path_manager_factory` is never initialized.
path_manager_factory: PathManagerFactory path_manager_factory: PathManagerFactory
path_manager_factory_class_type: str = "PathManagerFactory" path_manager_factory_class_type: str = "PathManagerFactory"
......
...@@ -83,7 +83,6 @@ class SingleSceneDataset(DatasetBase, Configurable): ...@@ -83,7 +83,6 @@ class SingleSceneDataset(DatasetBase, Configurable):
return self.eval_batches return self.eval_batches
# pyre-fixme[13]: Uninitialized attribute
class SingleSceneDatasetMapProviderBase(DatasetMapProviderBase): class SingleSceneDatasetMapProviderBase(DatasetMapProviderBase):
""" """
Base for provider of data for one scene from LLFF or blender datasets. Base for provider of data for one scene from LLFF or blender datasets.
...@@ -100,8 +99,11 @@ class SingleSceneDatasetMapProviderBase(DatasetMapProviderBase): ...@@ -100,8 +99,11 @@ class SingleSceneDatasetMapProviderBase(DatasetMapProviderBase):
testing frame. testing frame.
""" """
# pyre-fixme[13]: Attribute `base_dir` is never initialized.
base_dir: str base_dir: str
# pyre-fixme[13]: Attribute `object_name` is never initialized.
object_name: str object_name: str
# pyre-fixme[13]: Attribute `path_manager_factory` is never initialized.
path_manager_factory: PathManagerFactory path_manager_factory: PathManagerFactory
path_manager_factory_class_type: str = "PathManagerFactory" path_manager_factory_class_type: str = "PathManagerFactory"
n_known_frames_for_test: Optional[int] = None n_known_frames_for_test: Optional[int] = None
......
...@@ -348,6 +348,7 @@ def adjust_camera_to_image_scale_( ...@@ -348,6 +348,7 @@ def adjust_camera_to_image_scale_(
camera: PerspectiveCameras, camera: PerspectiveCameras,
original_size_wh: torch.Tensor, original_size_wh: torch.Tensor,
new_size_wh: torch.LongTensor, new_size_wh: torch.LongTensor,
# pyre-fixme[7]: Expected `PerspectiveCameras` but got implicit return value of `None`.
) -> PerspectiveCameras: ) -> PerspectiveCameras:
focal_length_px, principal_point_px = _convert_ndc_to_pixels( focal_length_px, principal_point_px = _convert_ndc_to_pixels(
camera.focal_length[0], camera.focal_length[0],
...@@ -367,7 +368,7 @@ def adjust_camera_to_image_scale_( ...@@ -367,7 +368,7 @@ def adjust_camera_to_image_scale_(
image_size_wh_output, image_size_wh_output,
) )
camera.focal_length = focal_length_scaled[None] camera.focal_length = focal_length_scaled[None]
camera.principal_point = principal_point_scaled[None] # pyre-ignore camera.principal_point = principal_point_scaled[None]
# NOTE this cache is per-worker; they are implemented as processes. # NOTE this cache is per-worker; they are implemented as processes.
......
...@@ -65,7 +65,7 @@ logger = logging.getLogger(__name__) ...@@ -65,7 +65,7 @@ logger = logging.getLogger(__name__)
@registry.register @registry.register
class GenericModel(ImplicitronModelBase): # pyre-ignore: 13 class GenericModel(ImplicitronModelBase):
""" """
GenericModel is a wrapper for the neural implicit GenericModel is a wrapper for the neural implicit
rendering and reconstruction pipeline which consists rendering and reconstruction pipeline which consists
...@@ -226,34 +226,42 @@ class GenericModel(ImplicitronModelBase): # pyre-ignore: 13 ...@@ -226,34 +226,42 @@ class GenericModel(ImplicitronModelBase): # pyre-ignore: 13
# ---- global encoder settings # ---- global encoder settings
global_encoder_class_type: Optional[str] = None global_encoder_class_type: Optional[str] = None
# pyre-fixme[13]: Attribute `global_encoder` is never initialized.
global_encoder: Optional[GlobalEncoderBase] global_encoder: Optional[GlobalEncoderBase]
# ---- raysampler # ---- raysampler
raysampler_class_type: str = "AdaptiveRaySampler" raysampler_class_type: str = "AdaptiveRaySampler"
# pyre-fixme[13]: Attribute `raysampler` is never initialized.
raysampler: RaySamplerBase raysampler: RaySamplerBase
# ---- renderer configs # ---- renderer configs
renderer_class_type: str = "MultiPassEmissionAbsorptionRenderer" renderer_class_type: str = "MultiPassEmissionAbsorptionRenderer"
# pyre-fixme[13]: Attribute `renderer` is never initialized.
renderer: BaseRenderer renderer: BaseRenderer
# ---- image feature extractor settings # ---- image feature extractor settings
# (This is only created if view_pooler is enabled) # (This is only created if view_pooler is enabled)
# pyre-fixme[13]: Attribute `image_feature_extractor` is never initialized.
image_feature_extractor: Optional[FeatureExtractorBase] image_feature_extractor: Optional[FeatureExtractorBase]
image_feature_extractor_class_type: Optional[str] = None image_feature_extractor_class_type: Optional[str] = None
# ---- view pooler settings # ---- view pooler settings
view_pooler_enabled: bool = False view_pooler_enabled: bool = False
# pyre-fixme[13]: Attribute `view_pooler` is never initialized.
view_pooler: Optional[ViewPooler] view_pooler: Optional[ViewPooler]
# ---- implicit function settings # ---- implicit function settings
implicit_function_class_type: str = "NeuralRadianceFieldImplicitFunction" implicit_function_class_type: str = "NeuralRadianceFieldImplicitFunction"
# This is just a model, never constructed. # This is just a model, never constructed.
# The actual implicit functions live in self._implicit_functions # The actual implicit functions live in self._implicit_functions
# pyre-fixme[13]: Attribute `implicit_function` is never initialized.
implicit_function: ImplicitFunctionBase implicit_function: ImplicitFunctionBase
# ----- metrics # ----- metrics
# pyre-fixme[13]: Attribute `view_metrics` is never initialized.
view_metrics: ViewMetricsBase view_metrics: ViewMetricsBase
view_metrics_class_type: str = "ViewMetrics" view_metrics_class_type: str = "ViewMetrics"
# pyre-fixme[13]: Attribute `regularization_metrics` is never initialized.
regularization_metrics: RegularizationMetricsBase regularization_metrics: RegularizationMetricsBase
regularization_metrics_class_type: str = "RegularizationMetrics" regularization_metrics_class_type: str = "RegularizationMetrics"
......
...@@ -59,12 +59,13 @@ class GlobalEncoderBase(ReplaceableBase): ...@@ -59,12 +59,13 @@ class GlobalEncoderBase(ReplaceableBase):
# TODO: probabilistic embeddings? # TODO: probabilistic embeddings?
@registry.register @registry.register
class SequenceAutodecoder(GlobalEncoderBase, torch.nn.Module): # pyre-ignore: 13 class SequenceAutodecoder(GlobalEncoderBase, torch.nn.Module):
""" """
A global encoder implementation which provides an autodecoder encoding A global encoder implementation which provides an autodecoder encoding
of the frame's sequence identifier. of the frame's sequence identifier.
""" """
# pyre-fixme[13]: Attribute `autodecoder` is never initialized.
autodecoder: Autodecoder autodecoder: Autodecoder
def __post_init__(self): def __post_init__(self):
......
...@@ -244,7 +244,6 @@ class MLPWithInputSkips(Configurable, torch.nn.Module): ...@@ -244,7 +244,6 @@ class MLPWithInputSkips(Configurable, torch.nn.Module):
@registry.register @registry.register
# pyre-fixme[13]: Attribute `network` is never initialized.
class MLPDecoder(DecoderFunctionBase): class MLPDecoder(DecoderFunctionBase):
""" """
Decoding function which uses `MLPWithIputSkips` to convert the embedding to output. Decoding function which uses `MLPWithIputSkips` to convert the embedding to output.
...@@ -272,6 +271,7 @@ class MLPDecoder(DecoderFunctionBase): ...@@ -272,6 +271,7 @@ class MLPDecoder(DecoderFunctionBase):
input_dim: int = 3 input_dim: int = 3
param_groups: Dict[str, str] = field(default_factory=lambda: {}) param_groups: Dict[str, str] = field(default_factory=lambda: {})
# pyre-fixme[13]: Attribute `network` is never initialized.
network: MLPWithInputSkips network: MLPWithInputSkips
def __post_init__(self): def __post_init__(self):
......
...@@ -318,10 +318,11 @@ class SRNRaymarchHyperNet(Configurable, torch.nn.Module): ...@@ -318,10 +318,11 @@ class SRNRaymarchHyperNet(Configurable, torch.nn.Module):
@registry.register @registry.register
# pyre-fixme[13]: Uninitialized attribute
class SRNImplicitFunction(ImplicitFunctionBase, torch.nn.Module): class SRNImplicitFunction(ImplicitFunctionBase, torch.nn.Module):
latent_dim: int = 0 latent_dim: int = 0
# pyre-fixme[13]: Attribute `raymarch_function` is never initialized.
raymarch_function: SRNRaymarchFunction raymarch_function: SRNRaymarchFunction
# pyre-fixme[13]: Attribute `pixel_generator` is never initialized.
pixel_generator: SRNPixelGenerator pixel_generator: SRNPixelGenerator
def __post_init__(self): def __post_init__(self):
...@@ -366,7 +367,6 @@ class SRNImplicitFunction(ImplicitFunctionBase, torch.nn.Module): ...@@ -366,7 +367,6 @@ class SRNImplicitFunction(ImplicitFunctionBase, torch.nn.Module):
@registry.register @registry.register
# pyre-fixme[13]: Uninitialized attribute
class SRNHyperNetImplicitFunction(ImplicitFunctionBase, torch.nn.Module): class SRNHyperNetImplicitFunction(ImplicitFunctionBase, torch.nn.Module):
""" """
This implicit function uses a hypernetwork to generate the This implicit function uses a hypernetwork to generate the
...@@ -377,7 +377,9 @@ class SRNHyperNetImplicitFunction(ImplicitFunctionBase, torch.nn.Module): ...@@ -377,7 +377,9 @@ class SRNHyperNetImplicitFunction(ImplicitFunctionBase, torch.nn.Module):
latent_dim_hypernet: int = 0 latent_dim_hypernet: int = 0
latent_dim: int = 0 latent_dim: int = 0
# pyre-fixme[13]: Attribute `hypernet` is never initialized.
hypernet: SRNRaymarchHyperNet hypernet: SRNRaymarchHyperNet
# pyre-fixme[13]: Attribute `pixel_generator` is never initialized.
pixel_generator: SRNPixelGenerator pixel_generator: SRNPixelGenerator
def __post_init__(self): def __post_init__(self):
......
...@@ -805,7 +805,6 @@ class VMFactorizedVoxelGrid(VoxelGridBase): ...@@ -805,7 +805,6 @@ class VMFactorizedVoxelGrid(VoxelGridBase):
) )
# pyre-fixme[13]: Attribute `voxel_grid` is never initialized.
class VoxelGridModule(Configurable, torch.nn.Module): class VoxelGridModule(Configurable, torch.nn.Module):
""" """
A wrapper torch.nn.Module for the VoxelGrid classes, which A wrapper torch.nn.Module for the VoxelGrid classes, which
...@@ -845,6 +844,7 @@ class VoxelGridModule(Configurable, torch.nn.Module): ...@@ -845,6 +844,7 @@ class VoxelGridModule(Configurable, torch.nn.Module):
""" """
voxel_grid_class_type: str = "FullResolutionVoxelGrid" voxel_grid_class_type: str = "FullResolutionVoxelGrid"
# pyre-fixme[13]: Attribute `voxel_grid` is never initialized.
voxel_grid: VoxelGridBase voxel_grid: VoxelGridBase
extents: Tuple[float, float, float] = (2.0, 2.0, 2.0) extents: Tuple[float, float, float] = (2.0, 2.0, 2.0)
......
...@@ -39,7 +39,6 @@ enable_get_default_args(HarmonicEmbedding) ...@@ -39,7 +39,6 @@ enable_get_default_args(HarmonicEmbedding)
@registry.register @registry.register
# pyre-ignore[13]
class VoxelGridImplicitFunction(ImplicitFunctionBase, torch.nn.Module): class VoxelGridImplicitFunction(ImplicitFunctionBase, torch.nn.Module):
""" """
This implicit function consists of two streams, one for the density calculation and one This implicit function consists of two streams, one for the density calculation and one
...@@ -145,9 +144,11 @@ class VoxelGridImplicitFunction(ImplicitFunctionBase, torch.nn.Module): ...@@ -145,9 +144,11 @@ class VoxelGridImplicitFunction(ImplicitFunctionBase, torch.nn.Module):
""" """
# ---- voxel grid for density # ---- voxel grid for density
# pyre-fixme[13]: Attribute `voxel_grid_density` is never initialized.
voxel_grid_density: VoxelGridModule voxel_grid_density: VoxelGridModule
# ---- voxel grid for color # ---- voxel grid for color
# pyre-fixme[13]: Attribute `voxel_grid_color` is never initialized.
voxel_grid_color: VoxelGridModule voxel_grid_color: VoxelGridModule
# ---- harmonic embeddings density # ---- harmonic embeddings density
...@@ -163,10 +164,12 @@ class VoxelGridImplicitFunction(ImplicitFunctionBase, torch.nn.Module): ...@@ -163,10 +164,12 @@ class VoxelGridImplicitFunction(ImplicitFunctionBase, torch.nn.Module):
# ---- decoder function for density # ---- decoder function for density
decoder_density_class_type: str = "MLPDecoder" decoder_density_class_type: str = "MLPDecoder"
# pyre-fixme[13]: Attribute `decoder_density` is never initialized.
decoder_density: DecoderFunctionBase decoder_density: DecoderFunctionBase
# ---- decoder function for color # ---- decoder function for color
decoder_color_class_type: str = "MLPDecoder" decoder_color_class_type: str = "MLPDecoder"
# pyre-fixme[13]: Attribute `decoder_color` is never initialized.
decoder_color: DecoderFunctionBase decoder_color: DecoderFunctionBase
# ---- cuda streams # ---- cuda streams
......
...@@ -69,7 +69,7 @@ IMPLICIT_FUNCTION_ARGS_TO_REMOVE: List[str] = [ ...@@ -69,7 +69,7 @@ IMPLICIT_FUNCTION_ARGS_TO_REMOVE: List[str] = [
@registry.register @registry.register
class OverfitModel(ImplicitronModelBase): # pyre-ignore: 13 class OverfitModel(ImplicitronModelBase):
""" """
OverfitModel is a wrapper for the neural implicit OverfitModel is a wrapper for the neural implicit
rendering and reconstruction pipeline which consists rendering and reconstruction pipeline which consists
...@@ -198,27 +198,34 @@ class OverfitModel(ImplicitronModelBase): # pyre-ignore: 13 ...@@ -198,27 +198,34 @@ class OverfitModel(ImplicitronModelBase): # pyre-ignore: 13
# ---- global encoder settings # ---- global encoder settings
global_encoder_class_type: Optional[str] = None global_encoder_class_type: Optional[str] = None
# pyre-fixme[13]: Attribute `global_encoder` is never initialized.
global_encoder: Optional[GlobalEncoderBase] global_encoder: Optional[GlobalEncoderBase]
# ---- raysampler # ---- raysampler
raysampler_class_type: str = "AdaptiveRaySampler" raysampler_class_type: str = "AdaptiveRaySampler"
# pyre-fixme[13]: Attribute `raysampler` is never initialized.
raysampler: RaySamplerBase raysampler: RaySamplerBase
# ---- renderer configs # ---- renderer configs
renderer_class_type: str = "MultiPassEmissionAbsorptionRenderer" renderer_class_type: str = "MultiPassEmissionAbsorptionRenderer"
# pyre-fixme[13]: Attribute `renderer` is never initialized.
renderer: BaseRenderer renderer: BaseRenderer
# ---- implicit function settings # ---- implicit function settings
share_implicit_function_across_passes: bool = False share_implicit_function_across_passes: bool = False
implicit_function_class_type: str = "NeuralRadianceFieldImplicitFunction" implicit_function_class_type: str = "NeuralRadianceFieldImplicitFunction"
# pyre-fixme[13]: Attribute `implicit_function` is never initialized.
implicit_function: ImplicitFunctionBase implicit_function: ImplicitFunctionBase
coarse_implicit_function_class_type: Optional[str] = None coarse_implicit_function_class_type: Optional[str] = None
# pyre-fixme[13]: Attribute `coarse_implicit_function` is never initialized.
coarse_implicit_function: Optional[ImplicitFunctionBase] coarse_implicit_function: Optional[ImplicitFunctionBase]
# ----- metrics # ----- metrics
# pyre-fixme[13]: Attribute `view_metrics` is never initialized.
view_metrics: ViewMetricsBase view_metrics: ViewMetricsBase
view_metrics_class_type: str = "ViewMetrics" view_metrics_class_type: str = "ViewMetrics"
# pyre-fixme[13]: Attribute `regularization_metrics` is never initialized.
regularization_metrics: RegularizationMetricsBase regularization_metrics: RegularizationMetricsBase
regularization_metrics_class_type: str = "RegularizationMetrics" regularization_metrics_class_type: str = "RegularizationMetrics"
......
...@@ -18,9 +18,7 @@ from .raymarcher import RaymarcherBase ...@@ -18,9 +18,7 @@ from .raymarcher import RaymarcherBase
@registry.register @registry.register
class MultiPassEmissionAbsorptionRenderer( # pyre-ignore: 13 class MultiPassEmissionAbsorptionRenderer(BaseRenderer, torch.nn.Module):
BaseRenderer, torch.nn.Module
):
""" """
Implements the multi-pass rendering function, in particular, Implements the multi-pass rendering function, in particular,
with emission-absorption ray marching used in NeRF [1]. First, it evaluates with emission-absorption ray marching used in NeRF [1]. First, it evaluates
...@@ -86,6 +84,7 @@ class MultiPassEmissionAbsorptionRenderer( # pyre-ignore: 13 ...@@ -86,6 +84,7 @@ class MultiPassEmissionAbsorptionRenderer( # pyre-ignore: 13
""" """
raymarcher_class_type: str = "EmissionAbsorptionRaymarcher" raymarcher_class_type: str = "EmissionAbsorptionRaymarcher"
# pyre-fixme[13]: Attribute `raymarcher` is never initialized.
raymarcher: RaymarcherBase raymarcher: RaymarcherBase
n_pts_per_ray_fine_training: int = 64 n_pts_per_ray_fine_training: int = 64
......
...@@ -16,8 +16,6 @@ from pytorch3d.renderer.implicit.sample_pdf import sample_pdf ...@@ -16,8 +16,6 @@ from pytorch3d.renderer.implicit.sample_pdf import sample_pdf
@expand_args_fields @expand_args_fields
# pyre-fixme[13]: Attribute `n_pts_per_ray` is never initialized.
# pyre-fixme[13]: Attribute `random_sampling` is never initialized.
class RayPointRefiner(Configurable, torch.nn.Module): class RayPointRefiner(Configurable, torch.nn.Module):
""" """
Implements the importance sampling of points along rays. Implements the importance sampling of points along rays.
...@@ -45,7 +43,9 @@ class RayPointRefiner(Configurable, torch.nn.Module): ...@@ -45,7 +43,9 @@ class RayPointRefiner(Configurable, torch.nn.Module):
for Anti-Aliasing Neural Radiance Fields." ICCV 2021. for Anti-Aliasing Neural Radiance Fields." ICCV 2021.
""" """
# pyre-fixme[13]: Attribute `n_pts_per_ray` is never initialized.
n_pts_per_ray: int n_pts_per_ray: int
# pyre-fixme[13]: Attribute `random_sampling` is never initialized.
random_sampling: bool random_sampling: bool
add_input_samples: bool = True add_input_samples: bool = True
blurpool_weights: bool = False blurpool_weights: bool = False
......
...@@ -24,9 +24,10 @@ from .rgb_net import RayNormalColoringNetwork ...@@ -24,9 +24,10 @@ from .rgb_net import RayNormalColoringNetwork
@registry.register @registry.register
class SignedDistanceFunctionRenderer(BaseRenderer, torch.nn.Module): # pyre-ignore[13] class SignedDistanceFunctionRenderer(BaseRenderer, torch.nn.Module):
render_features_dimensions: int = 3 render_features_dimensions: int = 3
object_bounding_sphere: float = 1.0 object_bounding_sphere: float = 1.0
# pyre-fixme[13]: Attribute `ray_tracer` is never initialized.
ray_tracer: RayTracing ray_tracer: RayTracing
ray_normal_coloring_network_args: DictConfig = get_default_args_field( ray_normal_coloring_network_args: DictConfig = get_default_args_field(
RayNormalColoringNetwork RayNormalColoringNetwork
......
...@@ -16,7 +16,6 @@ from .feature_aggregator import FeatureAggregatorBase ...@@ -16,7 +16,6 @@ from .feature_aggregator import FeatureAggregatorBase
from .view_sampler import ViewSampler from .view_sampler import ViewSampler
# pyre-ignore: 13
class ViewPooler(Configurable, torch.nn.Module): class ViewPooler(Configurable, torch.nn.Module):
""" """
Implements sampling of image-based features at the 2d projections of a set Implements sampling of image-based features at the 2d projections of a set
...@@ -35,8 +34,10 @@ class ViewPooler(Configurable, torch.nn.Module): ...@@ -35,8 +34,10 @@ class ViewPooler(Configurable, torch.nn.Module):
from a set of source images. FeatureAggregator executes step (4) above. from a set of source images. FeatureAggregator executes step (4) above.
""" """
# pyre-fixme[13]: Attribute `view_sampler` is never initialized.
view_sampler: ViewSampler view_sampler: ViewSampler
feature_aggregator_class_type: str = "AngleWeightedReductionFeatureAggregator" feature_aggregator_class_type: str = "AngleWeightedReductionFeatureAggregator"
# pyre-fixme[13]: Attribute `feature_aggregator` is never initialized.
feature_aggregator: FeatureAggregatorBase feature_aggregator: FeatureAggregatorBase
def __post_init__(self): def __post_init__(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment