mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-25 02:19:47 +08:00
Switch to ruff (#1939)
* `isort` -> `ruff` * `pylint` -> `ruff` * Remove line * More minor cleanup * Better documentation for rules we are enabling * Fix gitignore, run black * vscode settings --------- Co-authored-by: Matt Tancik <mattt4001@gmail.com>
This commit is contained in:
1 parent
814db32ec4
commit
d542646c72
79 files changed
+158
-237
No files matched your search
@@ -24,7 +24,7 @@ from jaxtyping import Int
|
||||
from torch import Tensor
|
||||
|
||||
|
||||
class PixelSampler: # pylint: disable=too-few-public-methods
|
||||
class PixelSampler:
|
||||
"""Samples 'pixel_batch's from 'image_batch's.
|
||||
|
||||
Args:
|
||||
@@ -45,7 +45,7 @@ class PixelSampler: # pylint: disable=too-few-public-methods
|
||||
"""
|
||||
self.num_rays_per_batch = num_rays_per_batch
|
||||
|
||||
def sample_method( # pylint: disable=no-self-use
|
||||
def sample_method(
|
||||
self,
|
||||
batch_size: int,
|
||||
num_images: int,
|
||||
@@ -203,7 +203,7 @@ class PixelSampler: # pylint: disable=too-few-public-methods
|
||||
return pixel_batch
|
||||
|
||||
|
||||
class EquirectangularPixelSampler(PixelSampler): # pylint: disable=too-few-public-methods
|
||||
class EquirectangularPixelSampler(PixelSampler):
|
||||
"""Samples 'pixel_batch's from 'image_batch's. Assumes images are
|
||||
equirectangular and the sampling is done uniformly on the sphere.
|
||||
|
||||
@@ -213,7 +213,7 @@ class EquirectangularPixelSampler(PixelSampler): # pylint: disable=too-few-publ
|
||||
"""
|
||||
|
||||
# overrides base method
|
||||
def sample_method( # pylint: disable=no-self-use
|
||||
def sample_method(
|
||||
self,
|
||||
batch_size: int,
|
||||
num_images: int,
|
||||
@@ -244,7 +244,7 @@ class EquirectangularPixelSampler(PixelSampler): # pylint: disable=too-few-publ
|
||||
return indices
|
||||
|
||||
|
||||
class PatchPixelSampler(PixelSampler): # pylint: disable=too-few-public-methods
|
||||
class PatchPixelSampler(PixelSampler):
|
||||
"""Samples 'pixel_batch's from 'image_batch's. Samples square patches
|
||||
from the images randomly. Useful for patch-based losses.
|
||||
|
||||
@@ -269,7 +269,7 @@ class PatchPixelSampler(PixelSampler): # pylint: disable=too-few-public-methods
|
||||
self.num_rays_per_batch = (num_rays_per_batch // (self.patch_size**2)) * (self.patch_size**2)
|
||||
|
||||
# overrides base method
|
||||
def sample_method( # pylint: disable=no-self-use
|
||||
def sample_method(
|
||||
self,
|
||||
batch_size: int,
|
||||
num_images: int,
|
||||
|
||||
Reference in new issue
Block a user