mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-04 14:58:55 +08:00
Fix linting errors throughout repo
This commit is contained in:
1 parent
0061b59b79
commit
c2a851ed92
8 files changed
+24
-11
No files matched your search
@@ -31,6 +31,8 @@ jobs:
|
|||||||
options: "--check --verbose --line-length=120"
|
options: "--check --verbose --line-length=120"
|
||||||
- name: Python Pylint GitHub Action
|
- name: Python Pylint GitHub Action
|
||||||
uses: vcoder4c/git_pylint@v3
|
uses: vcoder4c/git_pylint@v3
|
||||||
|
with:
|
||||||
|
options: "--max-line-length=120 --generated-members=numpy.*,torch.*,cv2.*,cv.* --good-names=i,j,x,y,lr --disable=too-many-arguments
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Test with pytest
|
- name: Test with pytest
|
||||||
|
|||||||
Vendored
+4
-2
@@ -19,7 +19,9 @@
|
|||||||
"python.testing.unittestEnabled": false,
|
"python.testing.unittestEnabled": false,
|
||||||
"python.testing.pytestEnabled": true,
|
"python.testing.pytestEnabled": true,
|
||||||
"python.linting.pylintArgs": [
|
"python.linting.pylintArgs": [
|
||||||
"--generated-members=numpy.* ,torch.* ,cv2.* , cv.*",
|
"--generated-members=numpy.*,torch.*,cv2.*,cv.*",
|
||||||
"--max-line-length=120"
|
"--max-line-length=120",
|
||||||
|
"--good-names=i,j,x,y,lr",
|
||||||
|
"--disable=too-many-arguments"
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
|
"""init modules"""
|
||||||
from .encoding import Encoding
|
from .encoding import Encoding
|
||||||
from .mlp import MLP
|
from .mlp import MLP
|
||||||
@@ -131,8 +131,8 @@ class RFFEncoding(Encoding):
|
|||||||
Returns:
|
Returns:
|
||||||
TensorType[..., "output_dim"]: Output values will be between -1 and 1
|
TensorType[..., "output_dim"]: Output values will be between -1 and 1
|
||||||
"""
|
"""
|
||||||
B = torch.normal(mean=0, std=self.scale, size=(self.in_dim, self.num_frequencies))
|
b_matrix = torch.normal(mean=0, std=self.scale, size=(self.in_dim, self.num_frequencies))
|
||||||
scaled_inputs = in_tensor @ B # [..., "num_frequencies"]
|
scaled_inputs = in_tensor @ b_matrix # [..., "num_frequencies"]
|
||||||
encoded_inputs = torch.cat([torch.sin(scaled_inputs), torch.cos(scaled_inputs)], axis=-1)
|
encoded_inputs = torch.cat([torch.sin(scaled_inputs), torch.cos(scaled_inputs)], axis=-1)
|
||||||
return encoded_inputs
|
return encoded_inputs
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
"""
|
||||||
|
Multi Layer Perceptron
|
||||||
|
"""
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from torch import nn
|
from torch import nn
|
||||||
|
|||||||
@@ -24,3 +24,7 @@ class Optimizer:
|
|||||||
NotImplementedError: _description_
|
NotImplementedError: _description_
|
||||||
"""
|
"""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
def test2(self):
|
||||||
|
"""Summary"""
|
||||||
|
raise NotImplementedError
|
||||||
@@ -2,11 +2,12 @@
|
|||||||
Collection of sampling strategies
|
Collection of sampling strategies
|
||||||
"""
|
"""
|
||||||
from typing import NamedTuple
|
from typing import NamedTuple
|
||||||
from torchtyping import TensorType
|
|
||||||
from torch import nn
|
|
||||||
import torch
|
|
||||||
import nerf.cameras as cameras
|
|
||||||
|
|
||||||
|
import torch
|
||||||
|
from torch import nn
|
||||||
|
from torchtyping import TensorType
|
||||||
|
|
||||||
|
from mattport.nerf import cameras
|
||||||
|
|
||||||
RaySamples = NamedTuple(
|
RaySamples = NamedTuple(
|
||||||
"RaySamples", [("locations", TensorType[..., "num_samples", 3]), ("deltas", TensorType[..., "num_samples"])]
|
"RaySamples", [("locations", TensorType[..., "num_samples", 3]), ("deltas", TensorType[..., "num_samples"])]
|
||||||
|
|||||||
@@ -3,10 +3,9 @@ Code to train model.
|
|||||||
"""
|
"""
|
||||||
from mattport.nerf.dataset.build import build_dataset
|
from mattport.nerf.dataset.build import build_dataset
|
||||||
from mattport.nerf.optimizer import Optimizer
|
from mattport.nerf.optimizer import Optimizer
|
||||||
from mattport.nerf.graph import Graph
|
|
||||||
|
|
||||||
|
|
||||||
class Trainer(object):
|
class Trainer:
|
||||||
"""Training class"""
|
"""Training class"""
|
||||||
|
|
||||||
def __init__(self, config: dict):
|
def __init__(self, config: dict):
|
||||||
@@ -23,7 +22,8 @@ class Trainer(object):
|
|||||||
|
|
||||||
def setup_graph(self):
|
def setup_graph(self):
|
||||||
"""_summary_"""
|
"""_summary_"""
|
||||||
self.graph = Graph()
|
# self.graph = Graph()
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
def setup_optimizer(self):
|
def setup_optimizer(self):
|
||||||
"""_summary_"""
|
"""_summary_"""
|
||||||
|
|||||||
Reference in new issue
Block a user