mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-07 00:09:14 +08:00
Fix linting issues
This commit is contained in:
1 parent
10761460de
commit
32af0082c7
4 files changed
+6
-10
No files matched your search
Vendored
+1
-1
@@ -32,6 +32,6 @@
|
|||||||
"--good-names=e,c,i,j,x,y,lr,K,fx,fy,cx,cy,H,W,ts,t,u",
|
"--good-names=e,c,i,j,x,y,lr,K,fx,fy,cx,cy,H,W,ts,t,u",
|
||||||
"--disable=too-many-arguments",
|
"--disable=too-many-arguments",
|
||||||
"--disable=fixme",
|
"--disable=fixme",
|
||||||
"--disable-msg=too-many-locals"
|
"--disable=too-many-locals"
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
@@ -116,7 +116,7 @@ class Trainer:
|
|||||||
def train_epoch(self):
|
def train_epoch(self):
|
||||||
"""_summary_"""
|
"""_summary_"""
|
||||||
num_iters = 100
|
num_iters = 100
|
||||||
for step in tqdm(range(num_iters)):
|
for _ in tqdm(range(num_iters)):
|
||||||
batch = next(iter(self.train_dataloader))
|
batch = next(iter(self.train_dataloader))
|
||||||
self.train_iteration(batch)
|
self.train_iteration(batch)
|
||||||
# TODO(): proper saving with the correct directory path and such
|
# TODO(): proper saving with the correct directory path and such
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
"""
|
"""
|
||||||
Field output tests
|
Field output tests
|
||||||
"""
|
"""
|
||||||
import pytest
|
|
||||||
import torch
|
import torch
|
||||||
from torch import nn
|
from torch import nn
|
||||||
|
|
||||||
@@ -19,7 +18,7 @@ def test_field_output():
|
|||||||
assert render_head.get_out_dim() == out_dim
|
assert render_head.get_out_dim() == out_dim
|
||||||
|
|
||||||
x = torch.ones((9, in_dim))
|
x = torch.ones((9, in_dim))
|
||||||
y = render_head(x)
|
render_head(x)
|
||||||
|
|
||||||
|
|
||||||
def test_density_output():
|
def test_density_output():
|
||||||
@@ -29,7 +28,7 @@ def test_density_output():
|
|||||||
assert density_head.get_out_dim() == 1
|
assert density_head.get_out_dim() == 1
|
||||||
|
|
||||||
x = torch.ones((9, in_dim))
|
x = torch.ones((9, in_dim))
|
||||||
y = density_head(x)
|
density_head(x)
|
||||||
|
|
||||||
|
|
||||||
def test_rgb_output():
|
def test_rgb_output():
|
||||||
@@ -39,4 +38,4 @@ def test_rgb_output():
|
|||||||
assert rgb_head.get_out_dim() == 3
|
assert rgb_head.get_out_dim() == 3
|
||||||
|
|
||||||
x = torch.ones((9, in_dim))
|
x = torch.ones((9, in_dim))
|
||||||
y = rgb_head(x)
|
rgb_head(x)
|
||||||
@@ -1,12 +1,9 @@
|
|||||||
"""
|
"""
|
||||||
Test samplers
|
Test samplers
|
||||||
"""
|
"""
|
||||||
from random import uniform
|
|
||||||
import pytest
|
|
||||||
import torch
|
import torch
|
||||||
from mattport.nerf.sampler import PDFSampler, UniformSampler
|
from mattport.nerf.sampler import PDFSampler, UniformSampler
|
||||||
|
|
||||||
from mattport.structures.cameras import Rays
|
|
||||||
from mattport.structures.rays import RayBundle
|
from mattport.structures.rays import RayBundle
|
||||||
|
|
||||||
|
|
||||||
@@ -45,7 +42,7 @@ def test_pdf_sampler():
|
|||||||
|
|
||||||
# Just check that it doesn't crash. Need to add some actual tests.
|
# Just check that it doesn't crash. Need to add some actual tests.
|
||||||
pdf_sampler = PDFSampler(num_samples)
|
pdf_sampler = PDFSampler(num_samples)
|
||||||
ray_samples = pdf_sampler(ray_bundle, coarse_ray_samples, density, num_samples)
|
pdf_sampler(ray_bundle, coarse_ray_samples, density, num_samples)
|
||||||
|
|
||||||
# TODO Tancik: Add more precise tests
|
# TODO Tancik: Add more precise tests
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user