Standalone, high-performance, 100% offline 2D-to-3D image and video converter
Python
1
16 commits
updated Sep 20, 2026
A standalone, high-performance, 100% offline 2D-to-3D image and video converter. Transforms conventional 2D photos and videos into stereoscopic 3D (Half-SBS, Full-SBS, Dubois Anaglyph) and Apple Spatial Video (MV-HEVC / Spatial Photos) with zero cloud dependency, no subscriptions, and complete privacy.
Features native hardware acceleration across platforms:
right_only mode): Keeps the original left eye 100% untouched and unwarped. Completely eliminates the line deformation, blurriness, and double-vision ghosting typical of naive DIBR converters.both mode. The repair reuses healthy frames and the existing audio, and runs depth inference only for frames carrying the one-sided signature._depth.mp4 / _depth.png) for manual grading in Photoshop, DaVinci Resolve, or After Effects, then re-render stereo in seconds without re-running AI inference.spatial packaging.en), secondary is Spanish (es). Community translation files can be dropped into locales/ and are automatically discovered by both the Web GUI and CLI.The converter includes a cross-platform diagnostic engine that inspects your GPU, PyTorch acceleration stack, and multimedia binaries on startup.
# Default English diagnostics
python convert_3d.py --check-system
# Spanish diagnostics
python convert_3d.py --check-system --lang es
Example Output:
========================================================================
2D TO 3D STUDIO - SYSTEM DIAGNOSTICS REPORT
========================================================================
Operating System: Darwin 23.6.0 (arm64)
AI Accelerator (GPU): Apple Silicon (arm) [Metal MPS] [MPS]
Video Encoder: Apple VideoToolbox (Hardware Acceleration) (hevc_videotoolbox)
FFmpeg Installed: ✓ Yes
Spatial CLI: ✓ Yes
Overall Status: OK
------------------------------------------------------------------------
✓ Excellent! All components and drivers are configured and optimized.
If drivers, CUDA packages, or FFmpeg are missing, the system will output actionable alerts with:
CRITICAL, RECOMMENDED, or OPTIONAL).winget install Gyan.FFmpeg on Windows, sudo apt install ffmpeg on Linux, pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121 for NVIDIA CUDA).The project includes a web studio interface with real-time SSE progress streaming, FPS telemetry, ETA calculation, optical sliders, preset selectors, and an interactive Hardware Diagnostics Modal.
start_windows.bat in the project folder.cd path\to\2D-to-3D
.venv\Scripts\activate
python gui.py
chmod +x start_linux.sh
./start_linux.sh
cd ~/2D-to-3D
source .venv/bin/activate
python3 gui.py
start_mac.command in the project root or the Desktop shortcut.cd ~/Dev/3D/2D-to-3D
source .venv/bin/activate
python3 gui.py
The GUI will automatically open in your default web browser at http://127.0.0.1:8765.
The Depth Model selector includes the built-in model plus ONNX, Transformers, Depth Anything 3, and ZoeDepth models. Models download on first use and are then read from the local Hugging Face or Torch cache.
# ONNX and Hugging Face models
python -m pip install -r requirements-pro.txt
# Additional DA3 models
python -m pip install -r requirements-da3.txt
# Inspect keys or select a model from the CLI
python convert_3d.py --list-depth-models
python convert_3d.py -i movie.mkv --depth-model da-v2-small-onnx
Metric estimators are converted to inverse depth before stereo synthesis so near objects retain the same disparity direction as the built-in model. Prompt Depth Anything uses the built-in estimator as its dense prompt when no LiDAR depth prompt is available.
winget install Gyan.FFmpeg
bin folder to your System PATH.cd path\to\2D-to-3D
python -m venv .venv
call .venv\Scripts\activate
:: For NVIDIA GPU acceleration (CUDA 12.1):
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121
:: Install remaining dependencies:
pip install -r requirements.txt
start_windows.bat.# Ubuntu / Debian / Linux Mint:
sudo apt update && sudo apt install -y python3 python3-venv python3-pip ffmpeg zenity
# Fedora / RHEL:
sudo dnf install -y python3 python3-pip ffmpeg zenity
# Arch Linux / Manjaro:
sudo pacman -S python python-pip ffmpeg zenity
cd ~/2D-to-3D
python3 -m venv .venv
source .venv/bin/activate
# If you have an NVIDIA GPU (CUDA 12.1):
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121
# If you have an AMD GPU (ROCm 6.0):
pip install torch torchvision --index-url https://download.pytorch.org/whl/rocm6.0
# Install all requirements:
pip install -r requirements.txt
./start_linux.sh or python3 gui.py.cd ~/Dev/3D/2D-to-3D
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
./start_mac.command or python3 gui.py.cd ~/Dev/3D/2D-to-3D
source .venv/bin/activate
# Convert an image to Half-SBS (3D TV format)
python convert_3d.py -i photo.jpg -f hsbs
# Convert a video to Dubois Anaglyph (Red/Cyan glasses)
python convert_3d.py -i video.mp4 -f anaglyph
# Convert to Apple Vision Pro Spatial Video (MV-HEVC)
python convert_3d.py -i video.mp4 -f spatial
Profiles automatically configure stereo divergence, convergence plane, and pop-out bias:
# Balanced profile (recommended baseline: comfortable parallax, zero ghosting)
python convert_3d.py -i video.mp4 --profile balanced
# Standard stereoscopic profiles available:
# --profile balanced : Balanced depth for movies and documentaries (0.025).
# --profile cinematic_depth : Enhanced depth sensation and volume for live-action films (0.030).
# --profile subtle_parallax : Gentle parallax for fast motion, text, and comfort (0.020).
# --profile high_contrast : Snapped depth edges for anime, animation, and high-contrast lines (0.022).
Export grayscale depth maps for inspection or manual retouching in video editing software:
# 1. Generate 3D video and save the depth map (_depth.mp4):
python convert_3d.py -i video.mp4 -f hsbs --save-depth
# 2. Re-export in seconds using an edited or existing depth map (skips AI inference):
python convert_3d.py -i video.mp4 --custom-depth video_depth.mp4 -f hsbs
-s and -t)Test depth settings on a short excerpt before processing an entire movie:
# Convert a 10-second test clip starting at second 30:
python convert_3d.py -i movie.mp4 -f hsbs -s 30 -t 10
If a movie was converted with right_only or left_only and visible warping is
found, the repair scanner can regenerate affected frames with symmetric
both-eye rendering. It needs the synchronized original 2D master and the
existing SBS conversion:
python -m src.stereo_artifact_repair \
--source-2d "/path/to/original-2d.mkv" \
--converted-3d "/path/to/existing-3d-hsbs.mp4" \
--output "/path/to/existing-3d-hsbs.repaired.mp4" \
--layout hsbs \
--repair-ranges auto \
--depth-intensity 0.030 \
--convergence 0.45 \
--temporal-smooth 0.70 \
--style-3d cinematic
--repair-ranges auto samples the conversion, detects camera cuts, compensates
normal stereo disparity, and scores missing edges, invented contours, local
blur, and residual deformation. It writes an adjacent
*.artifacts.json report listing every detected shot with its exact start,
end, peak score, and pristine eye. Only those reported shots run through depth
inference and symmetric reconstruction. For a manually identified artifact,
pass one or more time ranges in seconds, such as
--repair-ranges "812.5-819.2,1450-1455". Healthy frames are reused from the
existing conversion; only selected frames run through depth inference again.
The repaired video is encoded once and receives the audio from the existing 3D
file. The input files are never overwritten.
| Option | Default | Description |
|---|---|---|
-i, --input | None | Path to input 2D image or video file. |
-o, --output | Auto | Destination path for converted 3D file. |
-f, --format | hsbs | 3D Format: hsbs (Half-SBS), sbs (Full-SBS), anaglyph (Red/Cyan), spatial (Apple MV-HEVC / HEIC). |
--profile | None | Predefined profile: balanced, cinematic_depth, subtle_parallax, high_contrast. |
--render-mode | right_only | Stereo rendering mode: right_only (left eye pristine, no warping) or both (symmetric). |
--depth-intensity | 0.022 | Stereo separation strength (Parallax divergence: 0.010 subtle to 0.060 strong). |
--convergence | 0.50 | Zero-parallax screen plane (0.0 = pop out in front of screen, 1.0 = deep into screen). |
--temporal-smooth | 0.70 | Temporal anti-flicker smoothing weight across consecutive video frames (0.0 to 0.95). |
--save-depth | Disabled | Save estimated depth map as a separate video (_depth.mp4) or image (_depth.png). |
--custom-depth | None | Path to external depth map file. Skips AI model inference for instant stereo synthesis. |
-s, --start-time | 0.0 | Start time in seconds for video conversion. |
-t, --duration | 0.0 | Duration in seconds to convert (0.0 = full video). |
--no-crop | Disabled | Disable dynamic black-bar protection. The option name remains for CLI compatibility; enabled protection does not crop the output. |
--batch-size | 1 | Batch size for parallel depth inference on GPU (strict FIFO order). |
--depth-stride | 1 | Compute depth every N frames while preserving 100% genuine RGB frame motion. |
--resume | Disabled | Resume an interrupted conversion from the last frame-accurate checkpoint. |
--check-cadence | Disabled | Audit converted 3D output against 2D input for visual cadence and stutter detection. |
--repair-stutter | None | Path for output file to repair an already-defective video with frozen duplicate frames. |
--lang | en | UI and diagnostics language (en for English, es for Spanish, or any custom locale). |
--check-system | Flag | Run hardware, GPU acceleration, and encoder diagnostics without converting. |
2D to 3D Studio is built from the ground up to be multi-language. All user-facing strings are decoupled into standalone JSON files in the locales/ directory:
locales/
├── en.json # English (Default)
└── es.json # Spanish (Secondary)
You can contribute a new language without touching any Python or frontend code:
Copy the English template:
cp locales/en.json locales/<your_lang_code>.json
# Example for French:
cp locales/en.json locales/fr.json
Edit __meta__ in your new file:
{
"__meta__": {
"code": "fr",
"name": "Français",
"native_name": "Français"
},
"app": {
"title": "2D to 3D Studio",
"subtitle": "MOTEUR STÉRÉOSCOPIQUE ET SPATIAL HORS LIGNE"
}
}
Translate the string values. Missing keys automatically fall back to English (en).
Launch the app:
--lang <code_lang> (e.g. python convert_3d.py --check-system --lang fr).Pull requests adding new language translations are warmly welcome!
To run the end-to-end test suite on synthetic 3D geometry and verify model inference, stereo synthesis, and encoder pipelines:
python tests/test_pipeline.py
Expected output:
ALL TESTS PASSED! OFFLINE 2D-TO-3D PIPELINE IS 100% OPERATIONAL.
Standalone, high-performance, 100% offline 2D-to-3D image and video converter
Python
1
16 commits
updated Sep 20, 2026
A standalone, high-performance, 100% offline 2D-to-3D image and video converter. Transforms conventional 2D photos and videos into stereoscopic 3D (Half-SBS, Full-SBS, Dubois Anaglyph) and Apple Spatial Video (MV-HEVC / Spatial Photos) with zero cloud dependency, no subscriptions, and complete privacy.
Features native hardware acceleration across platforms:
right_only mode): Keeps the original left eye 100% untouched and unwarped. Completely eliminates the line deformation, blurriness, and double-vision ghosting typical of naive DIBR converters.both mode. The repair reuses healthy frames and the existing audio, and runs depth inference only for frames carrying the one-sided signature._depth.mp4 / _depth.png) for manual grading in Photoshop, DaVinci Resolve, or After Effects, then re-render stereo in seconds without re-running AI inference.spatial packaging.en), secondary is Spanish (es). Community translation files can be dropped into locales/ and are automatically discovered by both the Web GUI and CLI.The converter includes a cross-platform diagnostic engine that inspects your GPU, PyTorch acceleration stack, and multimedia binaries on startup.
# Default English diagnostics
python convert_3d.py --check-system
# Spanish diagnostics
python convert_3d.py --check-system --lang es
Example Output:
========================================================================
2D TO 3D STUDIO - SYSTEM DIAGNOSTICS REPORT
========================================================================
Operating System: Darwin 23.6.0 (arm64)
AI Accelerator (GPU): Apple Silicon (arm) [Metal MPS] [MPS]
Video Encoder: Apple VideoToolbox (Hardware Acceleration) (hevc_videotoolbox)
FFmpeg Installed: ✓ Yes
Spatial CLI: ✓ Yes
Overall Status: OK
------------------------------------------------------------------------
✓ Excellent! All components and drivers are configured and optimized.
If drivers, CUDA packages, or FFmpeg are missing, the system will output actionable alerts with:
CRITICAL, RECOMMENDED, or OPTIONAL).winget install Gyan.FFmpeg on Windows, sudo apt install ffmpeg on Linux, pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121 for NVIDIA CUDA).The project includes a web studio interface with real-time SSE progress streaming, FPS telemetry, ETA calculation, optical sliders, preset selectors, and an interactive Hardware Diagnostics Modal.
start_windows.bat in the project folder.cd path\to\2D-to-3D
.venv\Scripts\activate
python gui.py
chmod +x start_linux.sh
./start_linux.sh
cd ~/2D-to-3D
source .venv/bin/activate
python3 gui.py
start_mac.command in the project root or the Desktop shortcut.cd ~/Dev/3D/2D-to-3D
source .venv/bin/activate
python3 gui.py
The GUI will automatically open in your default web browser at http://127.0.0.1:8765.
The Depth Model selector includes the built-in model plus ONNX, Transformers, Depth Anything 3, and ZoeDepth models. Models download on first use and are then read from the local Hugging Face or Torch cache.
# ONNX and Hugging Face models
python -m pip install -r requirements-pro.txt
# Additional DA3 models
python -m pip install -r requirements-da3.txt
# Inspect keys or select a model from the CLI
python convert_3d.py --list-depth-models
python convert_3d.py -i movie.mkv --depth-model da-v2-small-onnx
Metric estimators are converted to inverse depth before stereo synthesis so near objects retain the same disparity direction as the built-in model. Prompt Depth Anything uses the built-in estimator as its dense prompt when no LiDAR depth prompt is available.
winget install Gyan.FFmpeg
bin folder to your System PATH.cd path\to\2D-to-3D
python -m venv .venv
call .venv\Scripts\activate
:: For NVIDIA GPU acceleration (CUDA 12.1):
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121
:: Install remaining dependencies:
pip install -r requirements.txt
start_windows.bat.# Ubuntu / Debian / Linux Mint:
sudo apt update && sudo apt install -y python3 python3-venv python3-pip ffmpeg zenity
# Fedora / RHEL:
sudo dnf install -y python3 python3-pip ffmpeg zenity
# Arch Linux / Manjaro:
sudo pacman -S python python-pip ffmpeg zenity
cd ~/2D-to-3D
python3 -m venv .venv
source .venv/bin/activate
# If you have an NVIDIA GPU (CUDA 12.1):
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121
# If you have an AMD GPU (ROCm 6.0):
pip install torch torchvision --index-url https://download.pytorch.org/whl/rocm6.0
# Install all requirements:
pip install -r requirements.txt
./start_linux.sh or python3 gui.py.cd ~/Dev/3D/2D-to-3D
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
./start_mac.command or python3 gui.py.cd ~/Dev/3D/2D-to-3D
source .venv/bin/activate
# Convert an image to Half-SBS (3D TV format)
python convert_3d.py -i photo.jpg -f hsbs
# Convert a video to Dubois Anaglyph (Red/Cyan glasses)
python convert_3d.py -i video.mp4 -f anaglyph
# Convert to Apple Vision Pro Spatial Video (MV-HEVC)
python convert_3d.py -i video.mp4 -f spatial
Profiles automatically configure stereo divergence, convergence plane, and pop-out bias:
# Balanced profile (recommended baseline: comfortable parallax, zero ghosting)
python convert_3d.py -i video.mp4 --profile balanced
# Standard stereoscopic profiles available:
# --profile balanced : Balanced depth for movies and documentaries (0.025).
# --profile cinematic_depth : Enhanced depth sensation and volume for live-action films (0.030).
# --profile subtle_parallax : Gentle parallax for fast motion, text, and comfort (0.020).
# --profile high_contrast : Snapped depth edges for anime, animation, and high-contrast lines (0.022).
Export grayscale depth maps for inspection or manual retouching in video editing software:
# 1. Generate 3D video and save the depth map (_depth.mp4):
python convert_3d.py -i video.mp4 -f hsbs --save-depth
# 2. Re-export in seconds using an edited or existing depth map (skips AI inference):
python convert_3d.py -i video.mp4 --custom-depth video_depth.mp4 -f hsbs
-s and -t)Test depth settings on a short excerpt before processing an entire movie:
# Convert a 10-second test clip starting at second 30:
python convert_3d.py -i movie.mp4 -f hsbs -s 30 -t 10
If a movie was converted with right_only or left_only and visible warping is
found, the repair scanner can regenerate affected frames with symmetric
both-eye rendering. It needs the synchronized original 2D master and the
existing SBS conversion:
python -m src.stereo_artifact_repair \
--source-2d "/path/to/original-2d.mkv" \
--converted-3d "/path/to/existing-3d-hsbs.mp4" \
--output "/path/to/existing-3d-hsbs.repaired.mp4" \
--layout hsbs \
--repair-ranges auto \
--depth-intensity 0.030 \
--convergence 0.45 \
--temporal-smooth 0.70 \
--style-3d cinematic
--repair-ranges auto samples the conversion, detects camera cuts, compensates
normal stereo disparity, and scores missing edges, invented contours, local
blur, and residual deformation. It writes an adjacent
*.artifacts.json report listing every detected shot with its exact start,
end, peak score, and pristine eye. Only those reported shots run through depth
inference and symmetric reconstruction. For a manually identified artifact,
pass one or more time ranges in seconds, such as
--repair-ranges "812.5-819.2,1450-1455". Healthy frames are reused from the
existing conversion; only selected frames run through depth inference again.
The repaired video is encoded once and receives the audio from the existing 3D
file. The input files are never overwritten.
| Option | Default | Description |
|---|---|---|
-i, --input | None | Path to input 2D image or video file. |
-o, --output | Auto | Destination path for converted 3D file. |
-f, --format | hsbs | 3D Format: hsbs (Half-SBS), sbs (Full-SBS), anaglyph (Red/Cyan), spatial (Apple MV-HEVC / HEIC). |
--profile | None | Predefined profile: balanced, cinematic_depth, subtle_parallax, high_contrast. |
--render-mode | right_only | Stereo rendering mode: right_only (left eye pristine, no warping) or both (symmetric). |
--depth-intensity | 0.022 | Stereo separation strength (Parallax divergence: 0.010 subtle to 0.060 strong). |
--convergence | 0.50 | Zero-parallax screen plane (0.0 = pop out in front of screen, 1.0 = deep into screen). |
--temporal-smooth | 0.70 | Temporal anti-flicker smoothing weight across consecutive video frames (0.0 to 0.95). |
--save-depth | Disabled | Save estimated depth map as a separate video (_depth.mp4) or image (_depth.png). |
--custom-depth | None | Path to external depth map file. Skips AI model inference for instant stereo synthesis. |
-s, --start-time | 0.0 | Start time in seconds for video conversion. |
-t, --duration | 0.0 | Duration in seconds to convert (0.0 = full video). |
--no-crop | Disabled | Disable dynamic black-bar protection. The option name remains for CLI compatibility; enabled protection does not crop the output. |
--batch-size | 1 | Batch size for parallel depth inference on GPU (strict FIFO order). |
--depth-stride | 1 | Compute depth every N frames while preserving 100% genuine RGB frame motion. |
--resume | Disabled | Resume an interrupted conversion from the last frame-accurate checkpoint. |
--check-cadence | Disabled | Audit converted 3D output against 2D input for visual cadence and stutter detection. |
--repair-stutter | None | Path for output file to repair an already-defective video with frozen duplicate frames. |
--lang | en | UI and diagnostics language (en for English, es for Spanish, or any custom locale). |
--check-system | Flag | Run hardware, GPU acceleration, and encoder diagnostics without converting. |
2D to 3D Studio is built from the ground up to be multi-language. All user-facing strings are decoupled into standalone JSON files in the locales/ directory:
locales/
├── en.json # English (Default)
└── es.json # Spanish (Secondary)
You can contribute a new language without touching any Python or frontend code:
Copy the English template:
cp locales/en.json locales/<your_lang_code>.json
# Example for French:
cp locales/en.json locales/fr.json
Edit __meta__ in your new file:
{
"__meta__": {
"code": "fr",
"name": "Français",
"native_name": "Français"
},
"app": {
"title": "2D to 3D Studio",
"subtitle": "MOTEUR STÉRÉOSCOPIQUE ET SPATIAL HORS LIGNE"
}
}
Translate the string values. Missing keys automatically fall back to English (en).
Launch the app:
--lang <code_lang> (e.g. python convert_3d.py --check-system --lang fr).Pull requests adding new language translations are warmly welcome!
To run the end-to-end test suite on synthetic 3D geometry and verify model inference, stereo synthesis, and encoder pipelines:
python tests/test_pipeline.py
Expected output:
ALL TESTS PASSED! OFFLINE 2D-TO-3D PIPELINE IS 100% OPERATIONAL.