diff --git a/2D_Stage/tuneavideo/__pycache__/util.cpython-310.pyc b/2D_Stage/tuneavideo/__pycache__/util.cpython-310.pyc index 5953ac0fa4fe24c914fadd38bfdcde2d4389870e..a83c383e2fb4927efecb0eca66d7388b9b4dc06d 100644 Binary files a/2D_Stage/tuneavideo/__pycache__/util.cpython-310.pyc and b/2D_Stage/tuneavideo/__pycache__/util.cpython-310.pyc differ diff --git a/2D_Stage/tuneavideo/models/__pycache__/PoseGuider.cpython-310.pyc b/2D_Stage/tuneavideo/models/__pycache__/PoseGuider.cpython-310.pyc index e320dc682997f9b86cda21f13f98938fd79f952e..9fdb664b92a9f47d40f326e9297c230a3cbe53f5 100644 Binary files a/2D_Stage/tuneavideo/models/__pycache__/PoseGuider.cpython-310.pyc and b/2D_Stage/tuneavideo/models/__pycache__/PoseGuider.cpython-310.pyc differ diff --git a/2D_Stage/tuneavideo/models/__pycache__/refunet.cpython-310.pyc b/2D_Stage/tuneavideo/models/__pycache__/refunet.cpython-310.pyc index 31248644f40de894f31e3fed15cba48159d1a219..ef8dcad96d95702932d1e2983039cd5ba6f2f937 100644 Binary files a/2D_Stage/tuneavideo/models/__pycache__/refunet.cpython-310.pyc and b/2D_Stage/tuneavideo/models/__pycache__/refunet.cpython-310.pyc differ diff --git a/2D_Stage/tuneavideo/models/__pycache__/resnet.cpython-310.pyc b/2D_Stage/tuneavideo/models/__pycache__/resnet.cpython-310.pyc index 0a79b133ac5b4194b65e50ebb8ca3c61728a754a..6f3b6d2a5277ae7ab3369785629137f62b38c505 100644 Binary files a/2D_Stage/tuneavideo/models/__pycache__/resnet.cpython-310.pyc and b/2D_Stage/tuneavideo/models/__pycache__/resnet.cpython-310.pyc differ diff --git a/2D_Stage/tuneavideo/models/__pycache__/transformer_mv2d.cpython-310.pyc b/2D_Stage/tuneavideo/models/__pycache__/transformer_mv2d.cpython-310.pyc index bbe7819084cd8956c182630ceffeb6b182539c37..c3fa123eeb34c1fa96d7048a0ffaef40ae06c0b1 100644 Binary files a/2D_Stage/tuneavideo/models/__pycache__/transformer_mv2d.cpython-310.pyc and b/2D_Stage/tuneavideo/models/__pycache__/transformer_mv2d.cpython-310.pyc differ diff --git a/2D_Stage/tuneavideo/models/__pycache__/unet.cpython-310.pyc b/2D_Stage/tuneavideo/models/__pycache__/unet.cpython-310.pyc index 21121a4b52a1a82cb15b9216ea7daecba9346466..7fc8b459e8c4977e2d027f0309ae14527d440c74 100644 Binary files a/2D_Stage/tuneavideo/models/__pycache__/unet.cpython-310.pyc and b/2D_Stage/tuneavideo/models/__pycache__/unet.cpython-310.pyc differ diff --git a/2D_Stage/tuneavideo/models/__pycache__/unet_blocks.cpython-310.pyc b/2D_Stage/tuneavideo/models/__pycache__/unet_blocks.cpython-310.pyc index 00e989a6cf04bb6d897adbc2b1c9c61c89c510dd..ac6dd23de6a67677e42a072fe2ef1708fe58731e 100644 Binary files a/2D_Stage/tuneavideo/models/__pycache__/unet_blocks.cpython-310.pyc and b/2D_Stage/tuneavideo/models/__pycache__/unet_blocks.cpython-310.pyc differ diff --git a/2D_Stage/tuneavideo/models/__pycache__/unet_mv2d_blocks.cpython-310.pyc b/2D_Stage/tuneavideo/models/__pycache__/unet_mv2d_blocks.cpython-310.pyc index aa48d7794254d516d67600ec263a38c7a4fdf1ab..d8f56ed7158e98c92f65e36793d241342473f2a0 100644 Binary files a/2D_Stage/tuneavideo/models/__pycache__/unet_mv2d_blocks.cpython-310.pyc and b/2D_Stage/tuneavideo/models/__pycache__/unet_mv2d_blocks.cpython-310.pyc differ diff --git a/2D_Stage/tuneavideo/models/__pycache__/unet_mv2d_condition.cpython-310.pyc b/2D_Stage/tuneavideo/models/__pycache__/unet_mv2d_condition.cpython-310.pyc index 72bfc1d6a187c50c5b78da649390861e03357209..c90f4f5dec04971cbc58dafca8aae1849e60dc0e 100644 Binary files a/2D_Stage/tuneavideo/models/__pycache__/unet_mv2d_condition.cpython-310.pyc and b/2D_Stage/tuneavideo/models/__pycache__/unet_mv2d_condition.cpython-310.pyc differ diff --git a/2D_Stage/tuneavideo/models/__pycache__/unet_mv2d_ref.cpython-310.pyc b/2D_Stage/tuneavideo/models/__pycache__/unet_mv2d_ref.cpython-310.pyc index 327665cc375fe7eb8caffce7b453205605887549..93d73675bccfc0dcb7170564ed920bfbcee83f5b 100644 Binary files a/2D_Stage/tuneavideo/models/__pycache__/unet_mv2d_ref.cpython-310.pyc and b/2D_Stage/tuneavideo/models/__pycache__/unet_mv2d_ref.cpython-310.pyc differ diff --git a/2D_Stage/tuneavideo/pipelines/__pycache__/pipeline_tuneavideo.cpython-310.pyc b/2D_Stage/tuneavideo/pipelines/__pycache__/pipeline_tuneavideo.cpython-310.pyc index fcd640fcb1172290f0d4cd4cd4674193a3d69f2f..c60380c841b90b6128c4acd28103223e53a0a954 100644 Binary files a/2D_Stage/tuneavideo/pipelines/__pycache__/pipeline_tuneavideo.cpython-310.pyc and b/2D_Stage/tuneavideo/pipelines/__pycache__/pipeline_tuneavideo.cpython-310.pyc differ diff --git a/2D_Stage/tuneavideo/pipelines/pipeline_tuneavideo.py b/2D_Stage/tuneavideo/pipelines/pipeline_tuneavideo.py index 9091ec1bafe1518efc9d1b2fea058875e7a61db3..ab8f46c94fcdebbfed4293f0307f513c7b215c2f 100644 --- a/2D_Stage/tuneavideo/pipelines/pipeline_tuneavideo.py +++ b/2D_Stage/tuneavideo/pipelines/pipeline_tuneavideo.py @@ -360,12 +360,12 @@ class TuneAVideoPipeline(DiffusionPipeline): if isinstance(generator, list): shape = (1,) + shape[1:] latents = [ - torch.randn(shape, generator=generator[i], device=rand_device, dtype=dtype) + torch.randn(shape, device=rand_device, dtype=dtype) for i in range(batch_size) ] latents = torch.cat(latents, dim=0).to(device) else: - latents = torch.randn(shape, generator=generator, device=rand_device, dtype=dtype).to(device) + latents = torch.randn(shape, device=rand_device, dtype=dtype).to(device) else: if latents.shape != shape: raise ValueError(f"Unexpected latents shape, got {latents.shape}, expected {shape}") diff --git a/3D_Stage/__pycache__/refine.cpython-310.pyc b/3D_Stage/__pycache__/refine.cpython-310.pyc index b8658b0bc98466ca048fca84191dc39eddffcf52..1157dd2125bf062408ce4f326a4058e0456fed60 100644 Binary files a/3D_Stage/__pycache__/refine.cpython-310.pyc and b/3D_Stage/__pycache__/refine.cpython-310.pyc differ diff --git a/3D_Stage/lrm/__pycache__/__init__.cpython-310.pyc b/3D_Stage/lrm/__pycache__/__init__.cpython-310.pyc index 11a2cb7489006db07dc65efdfcac86f035ecd3da..e4d4f8a48b63134565c6a459b01504fd9b76a611 100644 Binary files a/3D_Stage/lrm/__pycache__/__init__.cpython-310.pyc and b/3D_Stage/lrm/__pycache__/__init__.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/__pycache__/__init__.cpython-310.pyc b/3D_Stage/lrm/models/__pycache__/__init__.cpython-310.pyc index f17682021c33d5a7b0790333373117d79811268c..ae02a1faf4195564beba4c858d07c0f19d0785ae 100644 Binary files a/3D_Stage/lrm/models/__pycache__/__init__.cpython-310.pyc and b/3D_Stage/lrm/models/__pycache__/__init__.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/__pycache__/camera.cpython-310.pyc b/3D_Stage/lrm/models/__pycache__/camera.cpython-310.pyc index a023cc541ad77ea00277d3ba9105e94b05b4a34d..54bdd9967253e9b6881c77b74e040c183191a8ca 100644 Binary files a/3D_Stage/lrm/models/__pycache__/camera.cpython-310.pyc and b/3D_Stage/lrm/models/__pycache__/camera.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/__pycache__/isosurface.cpython-310.pyc b/3D_Stage/lrm/models/__pycache__/isosurface.cpython-310.pyc index cf4080fff569831451ff08c86f3dc92372614a0a..826437f1d3ec4794972a754daf1d5b9280d9a9f1 100644 Binary files a/3D_Stage/lrm/models/__pycache__/isosurface.cpython-310.pyc and b/3D_Stage/lrm/models/__pycache__/isosurface.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/__pycache__/lpips.cpython-310.pyc b/3D_Stage/lrm/models/__pycache__/lpips.cpython-310.pyc index fae7a4a8710c0c3109b076c56d2f097dfb11cc4f..429e99ebba129152630e63dbebe8b356406dfde6 100644 Binary files a/3D_Stage/lrm/models/__pycache__/lpips.cpython-310.pyc and b/3D_Stage/lrm/models/__pycache__/lpips.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/__pycache__/mesh.cpython-310.pyc b/3D_Stage/lrm/models/__pycache__/mesh.cpython-310.pyc index 62fca6b18e4f05b41ea54945792cf4ddadb9af5c..58e48c2e08f51280ac59b880415efe41b0105572 100644 Binary files a/3D_Stage/lrm/models/__pycache__/mesh.cpython-310.pyc and b/3D_Stage/lrm/models/__pycache__/mesh.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/__pycache__/networks.cpython-310.pyc b/3D_Stage/lrm/models/__pycache__/networks.cpython-310.pyc index 7ab189e75f751f9b5be165b1e990b350bdfe2156..d3c9220d4db23bbf6d8ce94bd311914c22386994 100644 Binary files a/3D_Stage/lrm/models/__pycache__/networks.cpython-310.pyc and b/3D_Stage/lrm/models/__pycache__/networks.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/background/__pycache__/__init__.cpython-310.pyc b/3D_Stage/lrm/models/background/__pycache__/__init__.cpython-310.pyc index 972d0f350f764abc73839b76bdf638c24a801936..c54293a4d9522b95b59449182506589fffe16078 100644 Binary files a/3D_Stage/lrm/models/background/__pycache__/__init__.cpython-310.pyc and b/3D_Stage/lrm/models/background/__pycache__/__init__.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/background/__pycache__/base.cpython-310.pyc b/3D_Stage/lrm/models/background/__pycache__/base.cpython-310.pyc index bf693f0ca6d3a7f5f1c763c3259294b19c979b61..f902ca46d15be7026632def081de60c9b967d975 100644 Binary files a/3D_Stage/lrm/models/background/__pycache__/base.cpython-310.pyc and b/3D_Stage/lrm/models/background/__pycache__/base.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/background/__pycache__/solid_color_background.cpython-310.pyc b/3D_Stage/lrm/models/background/__pycache__/solid_color_background.cpython-310.pyc index 34fffa5a35d42d5c16a01ad70beb972a1600d74d..63c8fa0c2bdacd44eaf78e71c72f35e15b7c8cf6 100644 Binary files a/3D_Stage/lrm/models/background/__pycache__/solid_color_background.cpython-310.pyc and b/3D_Stage/lrm/models/background/__pycache__/solid_color_background.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/camera.py b/3D_Stage/lrm/models/camera.py index 62461c3aadf73d1cd3f138eda5cd494ffe48d40a..2eeccb6adb5523def0f234e2ea0ad52d57642e6a 100644 --- a/3D_Stage/lrm/models/camera.py +++ b/3D_Stage/lrm/models/camera.py @@ -29,5 +29,7 @@ class LinearCameraEmbedder(BaseModule): cond_tensors.append(cond.view(*cond.shape[:2], -1)) cond_tensor = torch.cat(cond_tensors, dim=-1) assert cond_tensor.shape[-1] == self.cfg.in_channels + #self.linear = self.linear.to("cuda") + #print(self.linear.weight.device, cond_tensor.device) embedding = self.linear(cond_tensor) return embedding diff --git a/3D_Stage/lrm/models/exporters/__pycache__/__init__.cpython-310.pyc b/3D_Stage/lrm/models/exporters/__pycache__/__init__.cpython-310.pyc index f56d6beb9f10a09eb9a46483f19e9d041482b4db..e94dd4392c11c0f7a2a49c061720e7e0420039d5 100644 Binary files a/3D_Stage/lrm/models/exporters/__pycache__/__init__.cpython-310.pyc and b/3D_Stage/lrm/models/exporters/__pycache__/__init__.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/exporters/__pycache__/base.cpython-310.pyc b/3D_Stage/lrm/models/exporters/__pycache__/base.cpython-310.pyc index 66c8d8fa73cb06a51dcf2f418f0cdddad683f076..e25c7bf27c6582355d0e60c4eb24b14ffe7136ab 100644 Binary files a/3D_Stage/lrm/models/exporters/__pycache__/base.cpython-310.pyc and b/3D_Stage/lrm/models/exporters/__pycache__/base.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/exporters/__pycache__/mesh_exporter.cpython-310.pyc b/3D_Stage/lrm/models/exporters/__pycache__/mesh_exporter.cpython-310.pyc index daac7ce918fed706c94c7ecb45177fb9b627a929..734841b4a680f54be77059f6ba2b57594787b184 100644 Binary files a/3D_Stage/lrm/models/exporters/__pycache__/mesh_exporter.cpython-310.pyc and b/3D_Stage/lrm/models/exporters/__pycache__/mesh_exporter.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/exporters/mesh_exporter.py b/3D_Stage/lrm/models/exporters/mesh_exporter.py index 236fa48aa2e067f67b1df77b8b9963312b042a25..eda333bdb7b05c7e17a030760c21f097938ed6de 100644 --- a/3D_Stage/lrm/models/exporters/mesh_exporter.py +++ b/3D_Stage/lrm/models/exporters/mesh_exporter.py @@ -101,6 +101,7 @@ class MeshExporter(Exporter): def get_texture_maps( self, scene_code: torch.Tensor, mesh: Mesh ) -> Dict[str, torch.Tensor]: + #self.ctx = NVDiffRasterizerContext(self.cfg.context_type, self.device) assert mesh.has_uv # clip space transform uv_clip = mesh.v_tex * 2.0 - 1.0 diff --git a/3D_Stage/lrm/models/materials/__pycache__/__init__.cpython-310.pyc b/3D_Stage/lrm/models/materials/__pycache__/__init__.cpython-310.pyc index fee47762609bd07da41d20f2ebd66e972061c099..74bbcd22374e2bef98b6e35828e6458a574035fb 100644 Binary files a/3D_Stage/lrm/models/materials/__pycache__/__init__.cpython-310.pyc and b/3D_Stage/lrm/models/materials/__pycache__/__init__.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/materials/__pycache__/base.cpython-310.pyc b/3D_Stage/lrm/models/materials/__pycache__/base.cpython-310.pyc index 318ec225b344f57f8a7635ce5397f17b0386960b..58283adb812ee38a5049aff41286bd7f9607053b 100644 Binary files a/3D_Stage/lrm/models/materials/__pycache__/base.cpython-310.pyc and b/3D_Stage/lrm/models/materials/__pycache__/base.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/materials/__pycache__/no_material.cpython-310.pyc b/3D_Stage/lrm/models/materials/__pycache__/no_material.cpython-310.pyc index aa92003e4c061ea48875d41cd175cb6a2f103ba1..db3aeeb710f2c5400c469c6f7e9193478c8c53eb 100644 Binary files a/3D_Stage/lrm/models/materials/__pycache__/no_material.cpython-310.pyc and b/3D_Stage/lrm/models/materials/__pycache__/no_material.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/renderers/__pycache__/__init__.cpython-310.pyc b/3D_Stage/lrm/models/renderers/__pycache__/__init__.cpython-310.pyc index b1c90246e57e418181ddb7cf1d031a95345a5aad..89feb408e03577a9c97913945bece60c8a8fd1dd 100644 Binary files a/3D_Stage/lrm/models/renderers/__pycache__/__init__.cpython-310.pyc and b/3D_Stage/lrm/models/renderers/__pycache__/__init__.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/renderers/__pycache__/base.cpython-310.pyc b/3D_Stage/lrm/models/renderers/__pycache__/base.cpython-310.pyc index 990af8360e47c7575532e063020e812f767d17a6..2aace62a9c4e7f1786edd3719e4b73d12b4dc256 100644 Binary files a/3D_Stage/lrm/models/renderers/__pycache__/base.cpython-310.pyc and b/3D_Stage/lrm/models/renderers/__pycache__/base.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/renderers/__pycache__/triplane_dmtet.cpython-310.pyc b/3D_Stage/lrm/models/renderers/__pycache__/triplane_dmtet.cpython-310.pyc index 7879e52fdcea230c011f6963361d4266a70439f1..c2bdada1461366b1f9619a10431206094b586f94 100644 Binary files a/3D_Stage/lrm/models/renderers/__pycache__/triplane_dmtet.cpython-310.pyc and b/3D_Stage/lrm/models/renderers/__pycache__/triplane_dmtet.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/renderers/triplane_dmtet.py b/3D_Stage/lrm/models/renderers/triplane_dmtet.py index 6b898e3d584ef18307fb9ca2df0b015bc01f0430..227b9650770196f762d709e8b2efa1d0a9d19a2e 100644 --- a/3D_Stage/lrm/models/renderers/triplane_dmtet.py +++ b/3D_Stage/lrm/models/renderers/triplane_dmtet.py @@ -44,6 +44,8 @@ class TriplaneDMTetRenderer(BaseRenderer): assert self.cfg.feature_reduction in ["concat", "mean"] self.ctx = NVDiffRasterizerContext(self.cfg.context_type, self.device) + #self.ctx = None + self.isosurface_helper = MarchingTetrahedraHelper( self.cfg.isosurface_resolution, os.path.join(self.cfg.tet_dir, f"{self.cfg.isosurface_resolution}_tets.npz"), @@ -130,6 +132,7 @@ class TriplaneDMTetRenderer(BaseRenderer): background_color: Optional[Float[Tensor, "3"]], extra_sdf_query: Any = None, ) -> Dict[str, Tensor]: + #self.ctx = NVDiffRasterizerContext(self.cfg.context_type, self.device) Nv = mvp_mtx.shape[0] out = {} diff --git a/3D_Stage/lrm/models/tokenizers/__pycache__/__init__.cpython-310.pyc b/3D_Stage/lrm/models/tokenizers/__pycache__/__init__.cpython-310.pyc index 6bad6d50f1030b824f08335565f8951e0a23911e..310a14d0d4830956db6c412bef49fb6b8c3e6fd8 100644 Binary files a/3D_Stage/lrm/models/tokenizers/__pycache__/__init__.cpython-310.pyc and b/3D_Stage/lrm/models/tokenizers/__pycache__/__init__.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/tokenizers/__pycache__/dinov2.cpython-310.pyc b/3D_Stage/lrm/models/tokenizers/__pycache__/dinov2.cpython-310.pyc index 253dda7189e4f5908e292fd3dd12f93e635b1a95..35bc0582e4c7873301e7087bfc767a6c30873e4c 100644 Binary files a/3D_Stage/lrm/models/tokenizers/__pycache__/dinov2.cpython-310.pyc and b/3D_Stage/lrm/models/tokenizers/__pycache__/dinov2.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/tokenizers/__pycache__/image.cpython-310.pyc b/3D_Stage/lrm/models/tokenizers/__pycache__/image.cpython-310.pyc index 14567db9c6337002441ce50eddf7240ca764dcb6..42ad41ee5b1e36c0747bc0008b0f78732c401dad 100644 Binary files a/3D_Stage/lrm/models/tokenizers/__pycache__/image.cpython-310.pyc and b/3D_Stage/lrm/models/tokenizers/__pycache__/image.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/tokenizers/__pycache__/triplane.cpython-310.pyc b/3D_Stage/lrm/models/tokenizers/__pycache__/triplane.cpython-310.pyc index 7852e470011de48ca96a49a2afe508a11778d50d..e76b644deba2392ff406fb396d6cd81a86e45582 100644 Binary files a/3D_Stage/lrm/models/tokenizers/__pycache__/triplane.cpython-310.pyc and b/3D_Stage/lrm/models/tokenizers/__pycache__/triplane.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/transformers/__pycache__/__init__.cpython-310.pyc b/3D_Stage/lrm/models/transformers/__pycache__/__init__.cpython-310.pyc index c6090d4e5d79ba1617856de316c9a54294378dac..c5b571628faa31707da08ccefb46c97e435eb02f 100644 Binary files a/3D_Stage/lrm/models/transformers/__pycache__/__init__.cpython-310.pyc and b/3D_Stage/lrm/models/transformers/__pycache__/__init__.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/transformers/__pycache__/attention.cpython-310.pyc b/3D_Stage/lrm/models/transformers/__pycache__/attention.cpython-310.pyc index bb88bb7f9b8be2d001e355951fc593bad7811938..05b14ed1d5d61694bb37a89c221fe5d168169568 100644 Binary files a/3D_Stage/lrm/models/transformers/__pycache__/attention.cpython-310.pyc and b/3D_Stage/lrm/models/transformers/__pycache__/attention.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/transformers/__pycache__/transformer_1d.cpython-310.pyc b/3D_Stage/lrm/models/transformers/__pycache__/transformer_1d.cpython-310.pyc index 3c2f12253f2a402e0f105f5bd4a861b86ad99997..fd25be8c21cf4ed01e71673184d5a24a03cfd1c3 100644 Binary files a/3D_Stage/lrm/models/transformers/__pycache__/transformer_1d.cpython-310.pyc and b/3D_Stage/lrm/models/transformers/__pycache__/transformer_1d.cpython-310.pyc differ diff --git a/3D_Stage/lrm/models/transformers/attention.py b/3D_Stage/lrm/models/transformers/attention.py index 1b5891fcf694d94aa11385e057300841f2f4f326..e452fa2275f8d1a3a442cdbcc223863e849b2b8a 100644 --- a/3D_Stage/lrm/models/transformers/attention.py +++ b/3D_Stage/lrm/models/transformers/attention.py @@ -75,8 +75,8 @@ class MemoryEfficientAttentionMixin: # Any children which exposes the set_use_memory_efficient_attention_xformers method # gets the message def fn_recursive_set_mem_eff(module: torch.nn.Module): - if hasattr(module, "set_use_memory_efficient_attention_xformers"): - module.set_use_memory_efficient_attention_xformers(valid, attention_op) + #if hasattr(module, "set_use_memory_efficient_attention_xformers"): + # module.set_use_memory_efficient_attention_xformers(valid, attention_op) for child in module.children(): fn_recursive_set_mem_eff(child) diff --git a/3D_Stage/lrm/systems/__pycache__/__init__.cpython-310.pyc b/3D_Stage/lrm/systems/__pycache__/__init__.cpython-310.pyc index cf1919ac3ec290a368a055e64a355edde16ef688..49401dc1367d0627993e20fa143ada8235e26dae 100644 Binary files a/3D_Stage/lrm/systems/__pycache__/__init__.cpython-310.pyc and b/3D_Stage/lrm/systems/__pycache__/__init__.cpython-310.pyc differ diff --git a/3D_Stage/lrm/systems/__pycache__/base.cpython-310.pyc b/3D_Stage/lrm/systems/__pycache__/base.cpython-310.pyc index 66b51a45d4db03f0487834316e3d3a4a2df3fbbe..596fc90bf37c7d98d1ba87026c42a244288dfb4b 100644 Binary files a/3D_Stage/lrm/systems/__pycache__/base.cpython-310.pyc and b/3D_Stage/lrm/systems/__pycache__/base.cpython-310.pyc differ diff --git a/3D_Stage/lrm/systems/__pycache__/multiview_lrm.cpython-310.pyc b/3D_Stage/lrm/systems/__pycache__/multiview_lrm.cpython-310.pyc index 7f60105045ed31635a073319883ec154b5b32e62..8125e70cb6bbed9749c286277fae5734b1272c6f 100644 Binary files a/3D_Stage/lrm/systems/__pycache__/multiview_lrm.cpython-310.pyc and b/3D_Stage/lrm/systems/__pycache__/multiview_lrm.cpython-310.pyc differ diff --git a/3D_Stage/lrm/systems/__pycache__/utils.cpython-310.pyc b/3D_Stage/lrm/systems/__pycache__/utils.cpython-310.pyc index a534875804b82651fc6b50b133bb2fe0a5fb0f4b..cd4c61aa77cddf4a6a51ec4a10c8277809bdebb6 100644 Binary files a/3D_Stage/lrm/systems/__pycache__/utils.cpython-310.pyc and b/3D_Stage/lrm/systems/__pycache__/utils.cpython-310.pyc differ diff --git a/3D_Stage/lrm/systems/multiview_lrm.py b/3D_Stage/lrm/systems/multiview_lrm.py index 5bec99b677f9402bc453e866cf7d517132f2d80e..446b4a982c746ef800ab64d5adcde2e2b86de83e 100644 --- a/3D_Stage/lrm/systems/multiview_lrm.py +++ b/3D_Stage/lrm/systems/multiview_lrm.py @@ -62,19 +62,21 @@ class MultiviewLRM(BaseSystem): def configure(self): super().configure() + device = torch.device("cuda") self.image_tokenizer = lrm.find(self.cfg.image_tokenizer_cls)( self.cfg.image_tokenizer - ) + ).to(device) if self.cfg.image_tokenizer.modulation: self.camera_embedder = lrm.find(self.cfg.camera_embedder_cls)( self.cfg.camera_embedder - ) - self.tokenizer = lrm.find(self.cfg.tokenizer_cls)(self.cfg.tokenizer) + ).to(device) + #print(device, self.camera_embedder.linear.weight.device) + self.tokenizer = lrm.find(self.cfg.tokenizer_cls)(self.cfg.tokenizer).to(device) self.backbone = lrm.find(self.cfg.backbone_cls)(self.cfg.backbone) self.post_processor = lrm.find(self.cfg.post_processor_cls)( self.cfg.post_processor ) - self.decoder = lrm.find(self.cfg.decoder_cls)(self.cfg.decoder) + self.decoder = lrm.find(self.cfg.decoder_cls)(self.cfg.decoder).to(device) self.material = lrm.find(self.cfg.material_cls)(self.cfg.material) self.background = lrm.find(self.cfg.background_cls)(self.cfg.background) self.renderer = lrm.find(self.cfg.renderer_cls)( diff --git a/3D_Stage/lrm/utils/__pycache__/__init__.cpython-310.pyc b/3D_Stage/lrm/utils/__pycache__/__init__.cpython-310.pyc index c05284f8a5152209bd0f9a9035653ad1fd9728bf..2966a63c79f145b23fa769c9ba6552a669999548 100644 Binary files a/3D_Stage/lrm/utils/__pycache__/__init__.cpython-310.pyc and b/3D_Stage/lrm/utils/__pycache__/__init__.cpython-310.pyc differ diff --git a/3D_Stage/lrm/utils/__pycache__/base.cpython-310.pyc b/3D_Stage/lrm/utils/__pycache__/base.cpython-310.pyc index 703927bde6d567ee755f69fd7cf3de0f36d4a429..d916180ae22665c092bfcae5091fa82316485edf 100644 Binary files a/3D_Stage/lrm/utils/__pycache__/base.cpython-310.pyc and b/3D_Stage/lrm/utils/__pycache__/base.cpython-310.pyc differ diff --git a/3D_Stage/lrm/utils/__pycache__/config.cpython-310.pyc b/3D_Stage/lrm/utils/__pycache__/config.cpython-310.pyc index ccd21db0f9abe55d570041abfb7a86b5e516ae8b..a3abdaecb7ea3b51b20756d592714eed161cf533 100644 Binary files a/3D_Stage/lrm/utils/__pycache__/config.cpython-310.pyc and b/3D_Stage/lrm/utils/__pycache__/config.cpython-310.pyc differ diff --git a/3D_Stage/lrm/utils/__pycache__/misc.cpython-310.pyc b/3D_Stage/lrm/utils/__pycache__/misc.cpython-310.pyc index 86c8e20effdb82d860d08bf968e77a0a959236bf..cf50c8574c3c1c3abe6d7f4a70b19936aa8aa13c 100644 Binary files a/3D_Stage/lrm/utils/__pycache__/misc.cpython-310.pyc and b/3D_Stage/lrm/utils/__pycache__/misc.cpython-310.pyc differ diff --git a/3D_Stage/lrm/utils/__pycache__/ops.cpython-310.pyc b/3D_Stage/lrm/utils/__pycache__/ops.cpython-310.pyc index f89d5a08efc68069f828bf5891d8c23d4fc091c4..c0fcbe75e6595cdb0274192d8e3d309f97887f50 100644 Binary files a/3D_Stage/lrm/utils/__pycache__/ops.cpython-310.pyc and b/3D_Stage/lrm/utils/__pycache__/ops.cpython-310.pyc differ diff --git a/3D_Stage/lrm/utils/__pycache__/rasterize.cpython-310.pyc b/3D_Stage/lrm/utils/__pycache__/rasterize.cpython-310.pyc index 2d1674f762f923f27a7962d1291a6f1bd1e1fefb..d3d3e4110141186aa41197e0362835f432a60adb 100644 Binary files a/3D_Stage/lrm/utils/__pycache__/rasterize.cpython-310.pyc and b/3D_Stage/lrm/utils/__pycache__/rasterize.cpython-310.pyc differ diff --git a/3D_Stage/lrm/utils/__pycache__/saving.cpython-310.pyc b/3D_Stage/lrm/utils/__pycache__/saving.cpython-310.pyc index 84c44c97782e3f37f10221fd35be7704a8b3d50a..aa8f4787dd2dee1894077bb6512cd32f7917c9f9 100644 Binary files a/3D_Stage/lrm/utils/__pycache__/saving.cpython-310.pyc and b/3D_Stage/lrm/utils/__pycache__/saving.cpython-310.pyc differ diff --git a/3D_Stage/lrm/utils/__pycache__/typing.cpython-310.pyc b/3D_Stage/lrm/utils/__pycache__/typing.cpython-310.pyc index cc16ae3d9f50232b9c38a9fdaf829530b994fa5c..a66d0eccec17cf522a4c4614e72d16fc0b910642 100644 Binary files a/3D_Stage/lrm/utils/__pycache__/typing.cpython-310.pyc and b/3D_Stage/lrm/utils/__pycache__/typing.cpython-310.pyc differ diff --git a/3D_Stage/lrm/utils/rasterize.py b/3D_Stage/lrm/utils/rasterize.py index 448f37ea4432b9d351dee39f77e82665a4a78cbb..38b5d0f2cd0309a161d6588078141483474f535d 100644 --- a/3D_Stage/lrm/utils/rasterize.py +++ b/3D_Stage/lrm/utils/rasterize.py @@ -7,6 +7,7 @@ from .typing import * class NVDiffRasterizerContext: def __init__(self, context_type: str, device: torch.device) -> None: self.device = device + #self.ctx = None self.ctx = self.initialize_context(context_type, device) def initialize_context( diff --git a/app.py b/app.py index d333c95fe05d9e377a6153863260689357cc55ee..b75e363aa287ee3b9f0b28d7039128644604784a 100644 --- a/app.py +++ b/app.py @@ -1,3 +1,5 @@ +import spaces + import gradio as gr from PIL import Image import glob @@ -75,6 +77,7 @@ class rm_bg_api: session_infer_path, providers=providers, ) + @spaces.GPU def remove_background( self, imgs: list[np.ndarray], @@ -218,8 +221,9 @@ class Inference2D_API: ) self.validation_pipeline.enable_vae_slicing() self.validation_pipeline.set_progress_bar_config(disable=True) - self.generator = torch.Generator(device=device) + self.generator = torch.Generator() + @spaces.GPU @torch.no_grad() def inference(self, input_image, val_width, val_height, use_shifted_noise=False, crop=False, seed=100, timestep=20): @@ -305,7 +309,7 @@ class Inference3D_API: def __init__(self, device="cuda"): self.cfg = load_config("3D_Stage/configs/infer.yaml", makedirs=False) print("Loading system") - self.device = device + self.device = torch.device(device) self.cfg.system.weights = self.cfg.system.weights.replace("./", "./3D_Stage/") self.cfg.system.image_tokenizer.pretrained_model_name_or_path = \ self.cfg.system.image_tokenizer.pretrained_model_name_or_path.replace("./", "./3D_Stage/") @@ -314,7 +318,9 @@ class Inference3D_API: self.system = lrm.find(self.cfg.system_cls)(self.cfg.system).to(self.device) self.system.eval() + @spaces.GPU(duration=120) def process_images(self, img_input0, img_input1, img_input2, img_input3, back_proj, smooth_iter): + #self.system = self.system.to("cuda") meta = json.load(open("./3D_Stage/material/meta.json")) c2w_cond = [np.array(loc["transform_matrix"]) for loc in meta["locations"]] c2w_cond = torch.from_numpy(np.stack(c2w_cond, axis=0)).float()[None].to(self.device) @@ -370,7 +376,7 @@ class Inference3D_API: material.pbrMetallicRoughness.roughnessFactor = 1.0 gltf.save(f'{save_dir}/output.glb') - return save_dir, f"{save_dir}/output.obj", f"{save_dir}/output.glb" + return f"{save_dir}/output.obj", f"{save_dir}/output.glb" @torch.no_grad() def main( @@ -383,6 +389,7 @@ def main( infer3dapi = Inference3D_API() remove_api = rm_bg_api() + @spaces.GPU def gen4views(image, width, height, seed, timestep, remove_bg): if remove_bg: image = remove_api.remove_background( @@ -420,11 +427,11 @@ def main( img_input2 = gr.Image(type="pil", label="Right Image", image_mode="RGBA", width=256, height=384) img_input3 = gr.Image(type="pil", label="Left Image", image_mode="RGBA", width=256, height=384) with gr.Column(variant="panel"): - smooth_iter = gr.Slider(minimum=0, maximum=10, step=1, value=5, label="Laplacian Smoothing Iterations") + smooth_iter = gr.Slider(minimum=0, maximum=5, step=1, value=3, label="Laplacian Smoothing Iterations") with gr.Row(): back_proj = gr.Checkbox(label="Back Projection") button2 = gr.Button(value="Generate 3D Mesh") - output_dir = gr.Textbox(label="Output Directory") + # output_dir = gr.Textbox(label="Output Directory") with gr.Row(): with gr.Tab("GLB"): output_model_glb = gr.Model3D( label="Output Model (GLB Format)", height=512) @@ -440,7 +447,7 @@ def main( button2.click( infer3dapi.process_images, inputs=[img_input0, img_input1, img_input2, img_input3, back_proj, smooth_iter], - outputs=[output_dir, output_model_obj, output_model_glb] + outputs=[output_model_obj, output_model_glb] ) demo.launch() diff --git a/input.png b/input.png new file mode 100644 index 0000000000000000000000000000000000000000..79ad454c1f52a4dabe8e077a890c8b1966caf6ee Binary files /dev/null and b/input.png differ diff --git a/input_3D.png b/input_3D.png new file mode 100644 index 0000000000000000000000000000000000000000..b555a4844a31fbfb5acf153b8cd3a77b2011cc98 Binary files /dev/null and b/input_3D.png differ diff --git a/requirements.txt b/requirements.txt index 253bc34e6c7a6e181ea8d4a301e38b0c84116cc1..63520cb9a0f95faa31b62e3b2900fc5b2139e4b0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,6 @@ gradio rm_anime_bg # for 2D_stage -torch -torchvision accelerate transformers diffusers==0.24.0 @@ -11,7 +9,7 @@ einops imageio xformers onnxruntime -omegaconfls +omegaconf # for 3D_stage pytorch_lightning jaxtyping @@ -23,3 +21,4 @@ open3d trimesh pymeshlab pygltflib +omegaconf \ No newline at end of file