diff --git a/README.md b/README.md index e2f66207..d2f44cc9 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,10 @@ To run SV3D_u on a single image: - Download `sv3d_u.safetensors` from https://huggingface.co/stabilityai/sv3d to `checkpoints/sv3d_u.safetensors` - Run `python scripts/sampling/simple_video_sample.py --input_path --version sv3d_u` -Additionally for SV3D_p, -- Specify sequences of 21 elevations and 21 azimuths (in degrees) to `elevations_deg` ([-90, 90]), and `azimuths_deg` [0, 360] in sorted order from 0 to 360. For example: -`python scripts/sampling/simple_video_sample.py --input_path --version sv3d_p --elevations_deg [] --azimuths_deg []` +To run SV3D_u on a single image: +- Download `sv3d_p.safetensors` from https://huggingface.co/stabilityai/sv3d to `checkpoints/sv3d_p.safetensors` +1. Generate static orbit at a specified elevation eg. 10 : `python scripts/sampling/simple_video_sample.py --input_path --version sv3d_p --elevations_deg 10.0` +2. Generate dynamic orbit at a specified elevations and azimuths: specify sequences of 21 elevations (in degrees) to `elevations_deg` ([-90, 90]), and 21 azimuths (in degrees) to `azimuths_deg` [0, 360] in sorted order from 0 to 360. For example: `python scripts/sampling/simple_video_sample.py --input_path --version sv3d_p --elevations_deg [] --azimuths_deg []` To run SVD or SV3D on a streamlit server: `streamlit run scripts/demo/video_sampling.py` diff --git a/scripts/sampling/simple_video_sample.py b/scripts/sampling/simple_video_sample.py index 6d34e7cd..0609c3d8 100644 --- a/scripts/sampling/simple_video_sample.py +++ b/scripts/sampling/simple_video_sample.py @@ -84,7 +84,8 @@ def sample( polars_rad = [np.deg2rad(90 - e) for e in elevations_deg] if azimuths_deg is None: azimuths_deg = np.linspace(0, 360, num_frames + 1)[1:] % 360 - azimuths_rad = [np.deg2rad(a) for a in azimuths_deg] + azimuths_rad = [np.deg2rad((a - azimuths_deg[-1]) % 360) for a in azimuths_deg] + azimuths_rad[:-1].sort() else: raise ValueError(f"Version {version} does not exist.")