-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix] Fix potential circular import in core, data and utils, disconne…
…ct unnecessary pytorch3d dependency (#190) - Move mmhuman3d.core.visualization.renderer to mmhuman3d.core.renderer - Split mmhuman3d.core.renderer.torch3d_renderer.builder into several seperated builders. - Make __init__.py in mmhuman3d.core.renderer, mmhuman3d.data, mmhuman3d.utils empty. - Allow pytorch3d import failure in mmhuman3d.utils.transforms, because the transforms.py is widely imported by many modules that do not need pytorch3d at all (transforms.py is introduced by demo_utils.py). - Fix failed tests caused by the changes above. - Accept mmcv 1.5.2. Co-authored-by: gaoyang3 <[email protected]>
- Loading branch information
1 parent
4164f6a
commit 21a8ce7
Showing
48 changed files
with
207 additions
and
403 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
from mmcv.utils import Registry | ||
|
||
from .base_renderer import BaseRenderer | ||
from .depth_renderer import DepthRenderer | ||
from .mesh_renderer import MeshRenderer | ||
from .normal_renderer import NormalRenderer | ||
from .pointcloud_renderer import PointCloudRenderer | ||
from .segmentation_renderer import SegmentationRenderer | ||
from .silhouette_renderer import SilhouetteRenderer | ||
from .uv_renderer import UVRenderer | ||
|
||
RENDERER = Registry('renderer') | ||
RENDERER.register_module( | ||
name=['base', 'Base', 'base_renderer', 'BaseRenderer'], | ||
module=BaseRenderer) | ||
RENDERER.register_module( | ||
name=['Depth', 'depth', 'depth_renderer', 'DepthRenderer'], | ||
module=DepthRenderer) | ||
RENDERER.register_module( | ||
name=['Mesh', 'mesh', 'mesh_renderer', 'MeshRenderer'], | ||
module=MeshRenderer) | ||
RENDERER.register_module( | ||
name=['Normal', 'normal', 'normal_renderer', 'NormalRenderer'], | ||
module=NormalRenderer) | ||
RENDERER.register_module( | ||
name=[ | ||
'PointCloud', 'pointcloud', 'point_cloud', 'pointcloud_renderer', | ||
'PointCloudRenderer' | ||
], | ||
module=PointCloudRenderer) | ||
RENDERER.register_module( | ||
name=[ | ||
'segmentation', 'segmentation_renderer', 'Segmentation', | ||
'SegmentationRenderer' | ||
], | ||
module=SegmentationRenderer) | ||
RENDERER.register_module( | ||
name=[ | ||
'silhouette', 'silhouette_renderer', 'Silhouette', 'SilhouetteRenderer' | ||
], | ||
module=SilhouetteRenderer) | ||
RENDERER.register_module( | ||
name=['uv_renderer', 'uv', 'UV', 'UVRenderer'], module=UVRenderer) | ||
|
||
|
||
def build_renderer(cfg): | ||
"""Build renderers.""" | ||
return RENDERER.build(cfg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
mmhuman3d/core/renderer/torch3d_renderer/lights/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# yapf: disable | ||
from .builder import ( # noqa: F401 | ||
AmbientLights, | ||
DirectionalLights, | ||
PointLights, | ||
build_lights, | ||
) | ||
from .lights import MMLights # noqa: F401 | ||
|
||
# yapf: enable |
17 changes: 17 additions & 0 deletions
17
mmhuman3d/core/renderer/torch3d_renderer/lights/builder.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from mmcv.utils import Registry | ||
|
||
from .lights import AmbientLights, DirectionalLights, PointLights # noqa:E401 | ||
|
||
LIGHTS = Registry('lights') | ||
LIGHTS.register_module( | ||
name=['directional', 'directional_lights', 'DirectionalLights'], | ||
module=DirectionalLights) | ||
LIGHTS.register_module( | ||
name=['point', 'point_lights', 'PointLights'], module=PointLights) | ||
LIGHTS.register_module( | ||
name=['ambient', 'ambient_lights', 'AmbientLights'], module=AmbientLights) | ||
|
||
|
||
def build_lights(cfg): | ||
"""Build lights.""" | ||
return LIGHTS.build(cfg) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
mmhuman3d/core/renderer/torch3d_renderer/shader/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# yapf: disable | ||
from .builder import ( # noqa: F401 | ||
DepthShader, | ||
HardFlatShader, | ||
HardGouraudShader, | ||
HardPhongShader, | ||
NoLightShader, | ||
NormalShader, | ||
SegmentationShader, | ||
SilhouetteShader, | ||
SoftGouraudShader, | ||
SoftPhongShader, | ||
build_shader, | ||
) | ||
|
||
# yapf: enable |
Oops, something went wrong.