mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2026-01-16 19:30:34 +08:00
apply Black 25.11.0 style in fbcode (70/92)
Summary: Formats the covered files with pyfmt. paintitblack Reviewed By: itamaro Differential Revision: D90476295 fbshipit-source-id: 5101d4aae980a9f8955a4cb10bae23997c48837f
This commit is contained in:
committed by
meta-codesync[bot]
parent
6be5e2da06
commit
0c3b204375
@@ -8,7 +8,6 @@ from itertools import product
|
||||
|
||||
import torch
|
||||
from fvcore.common.benchmark import benchmark
|
||||
|
||||
from pytorch3d.ops.ball_query import ball_query
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
import unittest
|
||||
|
||||
import torch
|
||||
|
||||
from pytorch3d.implicitron.models.utils import preprocess_input, weighted_sum_losses
|
||||
|
||||
|
||||
|
||||
@@ -11,12 +11,10 @@ from dataclasses import dataclass
|
||||
from itertools import product
|
||||
|
||||
import numpy as np
|
||||
|
||||
import torch
|
||||
from pytorch3d.implicitron.dataset.data_loader_map_provider import (
|
||||
DoublePoolBatchSampler,
|
||||
)
|
||||
|
||||
from pytorch3d.implicitron.dataset.dataset_base import DatasetBase
|
||||
from pytorch3d.implicitron.dataset.frame_data import FrameData
|
||||
from pytorch3d.implicitron.dataset.scene_batch_sampler import SceneBatchSampler
|
||||
|
||||
@@ -7,9 +7,7 @@
|
||||
import unittest
|
||||
|
||||
import numpy as np
|
||||
|
||||
import torch
|
||||
|
||||
from pytorch3d.implicitron.dataset.utils import (
|
||||
bbox_xywh_to_xyxy,
|
||||
bbox_xyxy_to_xywh,
|
||||
@@ -21,7 +19,6 @@ from pytorch3d.implicitron.dataset.utils import (
|
||||
rescale_bbox,
|
||||
resize_image,
|
||||
)
|
||||
|
||||
from tests.common_testing import TestCaseMixin
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ import os
|
||||
import unittest
|
||||
|
||||
import torch
|
||||
|
||||
from pytorch3d.implicitron.dataset.data_loader_map_provider import ( # noqa
|
||||
SequenceDataLoaderMapProvider,
|
||||
SimpleDataLoaderMapProvider,
|
||||
|
||||
@@ -8,7 +8,6 @@ import os
|
||||
import unittest
|
||||
|
||||
from pytorch3d.implicitron import eval_demo
|
||||
|
||||
from tests.common_testing import interactive_testing_requested
|
||||
|
||||
from .common_resources import CO3D_MANIFOLD_PATH
|
||||
|
||||
@@ -15,7 +15,6 @@ import unittest
|
||||
import lpips
|
||||
import numpy as np
|
||||
import torch
|
||||
|
||||
from pytorch3d.implicitron.dataset.frame_data import FrameData
|
||||
from pytorch3d.implicitron.dataset.json_index_dataset import JsonIndexDataset
|
||||
from pytorch3d.implicitron.evaluation.evaluate_new_view_synthesis import eval_batch
|
||||
|
||||
@@ -14,7 +14,6 @@ from typing import ClassVar, Optional, Type
|
||||
import pandas as pd
|
||||
import pkg_resources
|
||||
import sqlalchemy as sa
|
||||
|
||||
from pytorch3d.implicitron.dataset import types
|
||||
from pytorch3d.implicitron.dataset.frame_data import FrameData, GenericFrameDataBuilder
|
||||
from pytorch3d.implicitron.dataset.orm_types import (
|
||||
|
||||
@@ -12,7 +12,6 @@ from typing import List
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
|
||||
from pytorch3d.implicitron.dataset import types
|
||||
from pytorch3d.implicitron.dataset.dataset_base import FrameData
|
||||
from pytorch3d.implicitron.dataset.frame_data import FrameDataBuilder
|
||||
@@ -29,7 +28,6 @@ from pytorch3d.implicitron.dataset.utils import (
|
||||
)
|
||||
from pytorch3d.implicitron.tools.config import get_default_args
|
||||
from pytorch3d.renderer.cameras import PerspectiveCameras
|
||||
|
||||
from tests.common_testing import TestCaseMixin
|
||||
from tests.implicitron.common_resources import get_skateboard_data
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ import unittest
|
||||
from typing import List
|
||||
|
||||
import numpy as np
|
||||
|
||||
import torch
|
||||
import torchvision
|
||||
from PIL import Image
|
||||
|
||||
@@ -13,7 +13,6 @@ from typing import Tuple
|
||||
import torch
|
||||
from pytorch3d.implicitron.dataset.json_index_dataset import JsonIndexDataset
|
||||
from pytorch3d.implicitron.dataset.visualize import get_implicitron_sequence_pointcloud
|
||||
|
||||
from pytorch3d.implicitron.models.visualization.render_flyaround import render_flyaround
|
||||
from pytorch3d.implicitron.tools.config import expand_args_fields
|
||||
from pytorch3d.implicitron.tools.point_cloud_utils import render_point_cloud_pytorch3d
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
import unittest
|
||||
|
||||
import numpy as np
|
||||
|
||||
import torch
|
||||
|
||||
from pytorch3d.implicitron.models.renderer.base import (
|
||||
approximate_conical_frustum_as_gaussians,
|
||||
compute_3d_diagonal_covariance_gaussian,
|
||||
@@ -18,7 +16,6 @@ from pytorch3d.implicitron.models.renderer.base import (
|
||||
ImplicitronRayBundle,
|
||||
)
|
||||
from pytorch3d.implicitron.models.renderer.ray_sampler import AbstractMaskRaySampler
|
||||
|
||||
from tests.common_testing import TestCaseMixin
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
import unittest
|
||||
from itertools import product
|
||||
from typing import Tuple
|
||||
|
||||
from unittest.mock import patch
|
||||
|
||||
import torch
|
||||
@@ -18,7 +17,6 @@ from pytorch3d.implicitron.models.renderer.ray_sampler import (
|
||||
compute_radii,
|
||||
NearFarRaySampler,
|
||||
)
|
||||
|
||||
from pytorch3d.renderer.cameras import (
|
||||
CamerasBase,
|
||||
FoVOrthographicCameras,
|
||||
@@ -28,7 +26,6 @@ from pytorch3d.renderer.cameras import (
|
||||
)
|
||||
from pytorch3d.renderer.implicit.utils import HeterogeneousRayBundle
|
||||
from tests.common_camera_utils import init_random_cameras
|
||||
|
||||
from tests.common_testing import TestCaseMixin
|
||||
|
||||
CAMERA_TYPES = (
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
import unittest
|
||||
|
||||
import numpy as np
|
||||
|
||||
from pytorch3d.implicitron.dataset.orm_types import ArrayTypeFactory, TupleTypeFactory
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import unittest
|
||||
|
||||
import torch
|
||||
from pytorch3d.implicitron.tools.point_cloud_utils import get_rgbd_point_cloud
|
||||
|
||||
from pytorch3d.renderer.cameras import PerspectiveCameras
|
||||
from tests.common_testing import TestCaseMixin
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import unittest
|
||||
from itertools import product
|
||||
|
||||
import torch
|
||||
|
||||
from pytorch3d.implicitron.models.renderer.ray_point_refiner import (
|
||||
apply_blurpool_on_weights,
|
||||
RayPointRefiner,
|
||||
|
||||
@@ -10,9 +10,7 @@ import unittest
|
||||
from collections import Counter
|
||||
|
||||
import pkg_resources
|
||||
|
||||
import torch
|
||||
|
||||
from pytorch3d.implicitron.dataset.sql_dataset import SqlIndexDataset
|
||||
|
||||
NO_BLOBS_KWARGS = {
|
||||
|
||||
@@ -16,7 +16,6 @@ from pytorch3d.implicitron.models.implicit_function.scene_representation_network
|
||||
from pytorch3d.implicitron.models.renderer.ray_sampler import ImplicitronRayBundle
|
||||
from pytorch3d.implicitron.tools.config import get_default_args
|
||||
from pytorch3d.renderer import PerspectiveCameras
|
||||
|
||||
from tests.common_testing import TestCaseMixin
|
||||
|
||||
_BATCH_SIZE: int = 3
|
||||
|
||||
@@ -8,13 +8,11 @@
|
||||
import unittest
|
||||
|
||||
import torch
|
||||
|
||||
from omegaconf import DictConfig, OmegaConf
|
||||
from pytorch3d.implicitron.models.implicit_function.voxel_grid_implicit_function import (
|
||||
VoxelGridImplicitFunction,
|
||||
)
|
||||
from pytorch3d.implicitron.models.renderer.base import ImplicitronRayBundle
|
||||
|
||||
from pytorch3d.implicitron.tools.config import expand_args_fields, get_default_args
|
||||
from pytorch3d.renderer import ray_bundle_to_ray_points
|
||||
from tests.common_testing import TestCaseMixin
|
||||
|
||||
@@ -10,7 +10,6 @@ from typing import Optional, Tuple
|
||||
|
||||
import torch
|
||||
from omegaconf import DictConfig, OmegaConf
|
||||
|
||||
from pytorch3d.implicitron.models.implicit_function.utils import (
|
||||
interpolate_line,
|
||||
interpolate_plane,
|
||||
@@ -22,7 +21,6 @@ from pytorch3d.implicitron.models.implicit_function.voxel_grid import (
|
||||
VMFactorizedVoxelGrid,
|
||||
VoxelGridModule,
|
||||
)
|
||||
|
||||
from pytorch3d.implicitron.tools.config import expand_args_fields, get_default_args
|
||||
from tests.common_testing import TestCaseMixin
|
||||
|
||||
|
||||
@@ -60,7 +60,6 @@ from pytorch3d.transforms.rotation_conversions import random_rotations
|
||||
from pytorch3d.transforms.so3 import so3_exp_map
|
||||
|
||||
from .common_camera_utils import init_random_cameras
|
||||
|
||||
from .common_testing import TestCaseMixin
|
||||
|
||||
|
||||
|
||||
@@ -673,9 +673,7 @@ class TestMeshPlyIO(TestCaseMixin, unittest.TestCase):
|
||||
|
||||
def test_load_simple_binary(self):
|
||||
for big_endian in [True, False]:
|
||||
verts = (
|
||||
"0 0 0 " "0 0 1 " "0 1 1 " "0 1 0 " "1 0 0 " "1 0 1 " "1 1 1 " "1 1 0"
|
||||
).split()
|
||||
verts = ("0 0 0 0 0 1 0 1 1 0 1 0 1 0 0 1 0 1 1 1 1 1 1 0").split()
|
||||
faces = (
|
||||
"4 0 1 2 3 "
|
||||
"4 7 6 5 4 "
|
||||
@@ -688,7 +686,7 @@ class TestMeshPlyIO(TestCaseMixin, unittest.TestCase):
|
||||
"3 4 5 1"
|
||||
).split()
|
||||
short_one = b"\00\01" if big_endian else b"\01\00"
|
||||
mixed_data = b"\00\00" b"\03\03" + (short_one + b"\00\01\01\01" b"\00\02")
|
||||
mixed_data = b"\00\00\03\03" + (short_one + b"\00\01\01\01\00\02")
|
||||
minus_one_data = b"\xff" * 14
|
||||
endian_char = ">" if big_endian else "<"
|
||||
format = (
|
||||
|
||||
@@ -604,9 +604,9 @@ class TestRaysampling(TestCaseMixin, unittest.TestCase):
|
||||
# test weather they are of the correct shape
|
||||
for attr in ("origins", "directions", "lengths", "xys"):
|
||||
tensor = getattr(ray_bundle, attr)
|
||||
assert tensor.shape[:2] == torch.Size(
|
||||
(n_rays_total, 1)
|
||||
), tensor.shape
|
||||
assert tensor.shape[:2] == torch.Size((n_rays_total, 1)), (
|
||||
tensor.shape
|
||||
)
|
||||
|
||||
# if two camera ids are same than origins should also be the same
|
||||
# directions and xys are always different and lengths equal
|
||||
|
||||
@@ -12,7 +12,6 @@ Sanity checks for output images from the renderer.
|
||||
import os
|
||||
import unittest
|
||||
from collections import namedtuple
|
||||
|
||||
from itertools import product
|
||||
|
||||
import numpy as np
|
||||
|
||||
Reference in New Issue
Block a user