Skip to content

Commit

Permalink
Rename utils files
Browse files Browse the repository at this point in the history
  • Loading branch information
bouchardi committed Mar 18, 2024
1 parent 3716147 commit eebb596
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 39 deletions.
6 changes: 2 additions & 4 deletions gaussian_splatting/gaussian_renderer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
import math

import torch
from diff_gaussian_rasterization import (
GaussianRasterizationSettings,
GaussianRasterizer,
)
from diff_gaussian_rasterization import (GaussianRasterizationSettings,
GaussianRasterizer)

from gaussian_splatting.scene.gaussian_model import GaussianModel

Expand Down
3 changes: 2 additions & 1 deletion gaussian_splatting/lpipsPyTorch/modules/lpips.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import torch
import torch.nn as nn

from gaussian_splatting.lpipsPyTorch.modules.networks import LinLayers, get_network
from gaussian_splatting.lpipsPyTorch.modules.networks import (LinLayers,
get_network)
from gaussian_splatting.lpipsPyTorch.modules.utils import get_state_dict


Expand Down
8 changes: 3 additions & 5 deletions gaussian_splatting/scene/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@
from gaussian_splatting.arguments import ModelParams
from gaussian_splatting.scene.dataset_readers import readColmapSceneInfo
from gaussian_splatting.scene.gaussian_model import GaussianModel
from gaussian_splatting.utils.camera_utils import (
camera_to_JSON,
cameraList_from_camInfos,
)
from gaussian_splatting.utils.system_utils import searchForMaxIteration
from gaussian_splatting.utils.camera import (camera_to_JSON,
cameraList_from_camInfos)
from gaussian_splatting.utils.system import searchForMaxIteration


class Scene:
Expand Down
3 changes: 2 additions & 1 deletion gaussian_splatting/scene/cameras.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
import torch
from torch import nn

from gaussian_splatting.utils.graphics_utils import getProjectionMatrix, getWorld2View2
from gaussian_splatting.utils.graphics import (getProjectionMatrix,
getWorld2View2)


class Camera(nn.Module):
Expand Down
18 changes: 8 additions & 10 deletions gaussian_splatting/scene/dataset_readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,15 @@
from PIL import Image
from plyfile import PlyData, PlyElement

from gaussian_splatting.scene.colmap_loader import (
qvec2rotmat,
read_extrinsics_binary,
read_extrinsics_text,
read_intrinsics_binary,
read_intrinsics_text,
read_points3D_binary,
read_points3D_text,
)
from gaussian_splatting.scene.colmap_loader import (qvec2rotmat,
read_extrinsics_binary,
read_extrinsics_text,
read_intrinsics_binary,
read_intrinsics_text,
read_points3D_binary,
read_points3D_text)
from gaussian_splatting.scene.gaussian_model import BasicPointCloud
from gaussian_splatting.utils.graphics_utils import focal2fov, getWorld2View2
from gaussian_splatting.utils.graphics import focal2fov, getWorld2View2


class CameraInfo(NamedTuple):
Expand Down
17 changes: 7 additions & 10 deletions gaussian_splatting/scene/gaussian_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@
from simple_knn._C import distCUDA2
from torch import nn

from gaussian_splatting.utils.general_utils import (
build_rotation,
build_scaling_rotation,
get_expon_lr_func,
inverse_sigmoid,
strip_symmetric,
)
from gaussian_splatting.utils.graphics_utils import BasicPointCloud
from gaussian_splatting.utils.sh_utils import RGB2SH
from gaussian_splatting.utils.system_utils import mkdir_p
from gaussian_splatting.utils.general import (build_rotation,
build_scaling_rotation,
get_expon_lr_func,
inverse_sigmoid, strip_symmetric)
from gaussian_splatting.utils.graphics import BasicPointCloud
from gaussian_splatting.utils.sh import RGB2SH
from gaussian_splatting.utils.system import mkdir_p


class GaussianModel:
Expand Down
6 changes: 3 additions & 3 deletions gaussian_splatting/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

from gaussian_splatting.gaussian_renderer import render
from gaussian_splatting.scene import GaussianModel, Scene
from gaussian_splatting.utils.general_utils import safe_state
from gaussian_splatting.utils.image_utils import psnr
from gaussian_splatting.utils.loss_utils import l1_loss, ssim
from gaussian_splatting.utils.general import safe_state
from gaussian_splatting.utils.image import psnr
from gaussian_splatting.utils.loss import l1_loss, ssim


class Trainer:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import numpy as np

from gaussian_splatting.scene.cameras import Camera
from gaussian_splatting.utils.general_utils import PILtoTorch
from gaussian_splatting.utils.graphics_utils import fov2focal
from gaussian_splatting.utils.general import PILtoTorch
from gaussian_splatting.utils.graphics import fov2focal

WARNED = False

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions scripts/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
from tqdm import tqdm

from gaussian_splatting.lpipsPyTorch import lpips
from gaussian_splatting.utils.image_utils import psnr
from gaussian_splatting.utils.loss_utils import ssim
from gaussian_splatting.utils.image import psnr
from gaussian_splatting.utils.loss import ssim


def readImages(renders_dir, gt_dir):
Expand Down
2 changes: 1 addition & 1 deletion scripts/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from gaussian_splatting.arguments import ModelParams, get_combined_args
from gaussian_splatting.gaussian_renderer import GaussianModel, render
from gaussian_splatting.scene import Scene
from gaussian_splatting.utils.general_utils import safe_state
from gaussian_splatting.utils.general import safe_state


def render_set(model_path, name, iteration, views, gaussians):
Expand Down

0 comments on commit eebb596

Please sign in to comment.