Replies: 16 comments 102 replies
-
|
I saw the sample, it looks very good, hope it's possible to use this model. |
Beta Was this translation helpful? Give feedback.
-
|
Gaussian Splatting seems more promising than SBS, as creating a client would allow users to change the viewpoint to some extent. |
Beta Was this translation helpful? Give feedback.
-
|
Trying to get it running locally. These projects need installation instructions for dummies. **"Getting started We recommend to first create a python environment: Afterwards, you can install the project using To test the installation, run You need Anaconda / miniconda... Installed miniconda.. ..Step 2... "Afterwards, you can install the project using Well that doesn't work, because steps are missing and requirements.txt doesn't exist. Why not put all of the steps?I always say, for some of these projects, the people/teams are so smart to create the projects, but such dummies to not provide simple instructions for people to use it. They assume people know what they know and so they skip steps. So I'm guessing I have to 'git pull' the repo? Where? How? I don't know. Doesn't work anyway, I'm in Anaconda prompt.. did the first step... ran conda activate sharp to be in the sharp environment.. Error message: |
Beta Was this translation helpful? Give feedback.
-
|
Hi there @QuickscopingFTW and @nagadomi, |
Beta Was this translation helpful? Give feedback.
-
|
The following is a simple way to perform stereo rendering with ml-sharp. output examples see #584 (reply in thread) def render_gaussians(
gaussians: Gaussians3D,
metadata: SceneMetaData,
output_path: Path,
params: camera.TrajectoryParams | None = None,
) -> None:
"""Render a single gaussian checkpoint file."""
(width, height) = metadata.resolution_px
f_px = metadata.focal_length_px
if params is None:
params = camera.TrajectoryParams()
if not torch.cuda.is_available():
raise RuntimeError("Rendering a checkpoint requires CUDA.")
device = torch.device("cuda")
intrinsics = torch.tensor(
[
[f_px, 0, (width - 1) / 2.0, 0],
[0, f_px, (height - 1) / 2.0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1],
],
device=device,
dtype=torch.float32,
)
camera_model = camera.create_camera_model(
gaussians, intrinsics, resolution_px=metadata.resolution_px
)
# Right camera offset: Increasing this value will increase the 3D strength, making objects appear smaller.
# TODO: I haven't looked into the units or scene normalization in detail yet.
baseline = 0.065
# Number of camera animation loops
params.num_repeats = 3
trajectory = camera.create_eye_trajectory(
gaussians, params, resolution_px=metadata.resolution_px, f_px=f_px
)
renderer = gsplat.GSplatRenderer(color_space=metadata.color_space)
video_writer = io.VideoWriter(output_path)
for _, eye_position in enumerate(trajectory):
camera_info = camera_model.compute(eye_position)
rendering_output = renderer(
gaussians.to(device),
extrinsics=camera_info.extrinsics[None].to(device),
intrinsics=camera_info.intrinsics[None].to(device),
image_width=camera_info.width,
image_height=camera_info.height,
)
# Left view
color_l = (rendering_output.color[0].permute(1, 2, 0) * 255.0).to(dtype=torch.uint8)
depth_l = rendering_output.depth[0]
# Set the right camera and render the right camera view
eye_position_r = eye_position.clone()
eye_position_r[0] += baseline
camera_info = camera_model.compute(eye_position_r)
rendering_output = renderer(
gaussians.to(device),
extrinsics=camera_info.extrinsics[None].to(device),
intrinsics=camera_info.intrinsics[None].to(device),
image_width=camera_info.width,
image_height=camera_info.height,
)
color_r = (rendering_output.color[0].permute(1, 2, 0) * 255.0).to(dtype=torch.uint8)
depth_r = rendering_output.depth[0]
# Pack the left and right views into SBS format.
color = torch.cat((color_l, color_r), dim=1)
depth = torch.cat((depth_l, depth_r), dim=0)
video_writer.add_frame(color, depth)
video_writer.close()diff diff --git a/src/sharp/cli/render.py b/src/sharp/cli/render.py
index 22c0bf8..953ed52 100644
--- a/src/sharp/cli/render.py
+++ b/src/sharp/cli/render.py
@@ -99,6 +99,12 @@ def render_gaussians(
gaussians, intrinsics, resolution_px=metadata.resolution_px
)
+ # Right camera offset: Increasing this value will increase the 3D strength, making objects appear smaller.
+ # TODO: I haven't looked into the units or scene normalization in detail yet.
+ baseline = 0.065
+ # Number of camera animation loops
+ params.num_repeats = 3
+
trajectory = camera.create_eye_trajectory(
gaussians, params, resolution_px=metadata.resolution_px, f_px=f_px
)
@@ -114,7 +120,26 @@ def render_gaussians(
image_width=camera_info.width,
image_height=camera_info.height,
)
- color = (rendering_output.color[0].permute(1, 2, 0) * 255.0).to(dtype=torch.uint8)
- depth = rendering_output.depth[0]
+ # Left view
+ color_l = (rendering_output.color[0].permute(1, 2, 0) * 255.0).to(dtype=torch.uint8)
+ depth_l = rendering_output.depth[0]
+
+ # Set the right camera and render the right camera view
+ eye_position_r = eye_position.clone()
+ eye_position_r[0] += baseline
+ camera_info = camera_model.compute(eye_position_r)
+ rendering_output = renderer(
+ gaussians.to(device),
+ extrinsics=camera_info.extrinsics[None].to(device),
+ intrinsics=camera_info.intrinsics[None].to(device),
+ image_width=camera_info.width,
+ image_height=camera_info.height,
+ )
+ color_r = (rendering_output.color[0].permute(1, 2, 0) * 255.0).to(dtype=torch.uint8)
+ depth_r = rendering_output.depth[0]
+
+ # Pack the left and right views into SBS format.
+ color = torch.cat((color_l, color_r), dim=1)
+ depth = torch.cat((depth_l, depth_r), dim=0)
video_writer.add_frame(color, depth)
video_writer.close()The video encoding options can be changed as follows. diff --git a/src/sharp/utils/io.py b/src/sharp/utils/io.py
index 07a98be..b3e2e96 100644
--- a/src/sharp/utils/io.py
+++ b/src/sharp/utils/io.py
@@ -186,7 +186,7 @@ class VideoWriter(OutputWriter):
"""Initialize VideoWriter."""
output_path.parent.mkdir(exist_ok=True, parents=True)
self.output_path = output_path
- self.image_writer = iio.get_writer(output_path, fps=fps)
+ self.image_writer = iio.get_writer(output_path, fps=fps, codec="libx264", ffmpeg_params=["-crf", "16"])
self.max_depth_estimate = None
if render_depth:EDIT: diff --git a/src/sharp/utils/camera.py b/src/sharp/utils/camera.py
index cad9a0a..0638bba 100644
--- a/src/sharp/utils/camera.py
+++ b/src/sharp/utils/camera.py
@@ -223,8 +223,8 @@ def create_camera_model(
screen_extrinsics=screen_extrinsics,
screen_intrinsics=screen_intrinsics,
screen_resolution_px=screen_resolution_px,
- focus_depth_quantile=0.1,
- min_depth_focus=2.0,
+ focus_depth_quantile=0.5,
+ min_depth_focus=0.0,
lookat_mode=lookat_mode,
)
return camera_modelThe camera in sharp is already converged, as the left and right cameras are oriented toward the lookat_point. However, that point is currently set outside the 3DGS scene due to a large NOTE: |
Beta Was this translation helpful? Give feedback.
-
|
What's your patreon nagadomi? Or Ko-fi?
…On Tue, Dec 30, 2025 at 2:14 AM nagadomi ***@***.***> wrote:
Since it may not work if the versions don't match, you'll need to include
instructions for installing the specified version of torch.
You can check the install commands
https://pytorch.org/get-started/locally/
To uninstall torch torchvision, use python -m pip uninstall torch
torchvision -y. I'm not using conda, so I don't know the conda commands.
—
Reply to this email directly, view it on GitHub
<#584 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BCE2ERPAOAZ6XZLKJPOZE334EIC2DAVCNFSM6AAAAACQEB53MWVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTKMZXGI3DKOI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
|
Beta Was this translation helpful? Give feedback.
-
|
Now it's working again. Apple's sharp is really amazing :-D |
Beta Was this translation helpful? Give feedback.
-
|
Here is the 3D SBS video conversion with Apple's sharp. breakdance-Apples-sharp.10bit.1.mp4 |
Beta Was this translation helpful? Give feedback.
-
|
for comparision, I only converted the right sides. I will make a comparison between baseline = 0.035 and baseline = 0.065 later |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
Here I made a comparison between Apple's Sharp and StereoSpace, the difference is quite big, especially the fog and the floor: |
Beta Was this translation helpful? Give feedback.
-
|
I have tried many times, but still I have problem to convert this beatle with Apple's sharp. Maybe you have the same problem? |
Beta Was this translation helpful? Give feedback.
-
|
If the depth of sharp isn't 2x stronger than the IW3 Inpaint version's max, the 3D videos still turn out good. Just need to work on the speed, I think it's fixable 😊. |
Beta Was this translation helpful? Give feedback.
-
|
Today I tested with video again, for a 4 minutes video both sides, full sbs 1080p. It took about 8 hours |
Beta Was this translation helpful? Give feedback.
-
|
a 3D convertor with ml-sharp, maybe you will be interested: |
Beta Was this translation helpful? Give feedback.













Uh oh!
There was an error while loading. Please reload this page.
-
I was reading about the new Apple's SHARP model that can create 3D representation of 2D images. It might actually be better than the current depth mapping technology. What do you guys think?
https://apple.github.io/ml-sharp/
Beta Was this translation helpful? Give feedback.
All reactions