DUPLICATE, ORIGINAL REPO WAS HERE

Stereo (Side by Side) Image Generation from Single Image

Utilizes AI to instantly fully convert 2D content into stereo 3D

image

Fig) Input image(Left) / Output(Middle) / 3D effect(Right)

Introduce

With the rapid of autostereoscopic 3D monitors, through the specialized optical lens and eye-tracking technology delivers users have an entirely new stereoscopic 3D visualization experience. However, it only works with 3D content inputs (Stereoscopic Images). Such as side-by-side images. But most image or video on the internet is 2D single view content. Making the technology difficult to popularize. In order to solve this problem, this project utilizes "Deep Learning" and "Computer Vision" to enable conversion of 2D content into stereo 3D content.

Changelog

  • [Aug 2020] Release C++ and cython version
  • [Aug 2020] Initial release of stereo image generation base on MiDaS v2.0

Setup

  1. Download the model weights model-f45da743.pt and place the file in the root folder.

  2. Set up dependencies:

    pip install torch  
    pip install torchvision
    pip install opencv_python
    pip install tqdm

    The code was tested with Cuda 10.1, Python 3.6.6, PyTorch 1.6.0, Torchvision 0.7.0 and OpenCV 3.4.0.12.

Usage

  1. Place input images in the folder example.

  2. Run the model:

    (Generate depth map from image)

    python depth_estimate_image.py

    (Generate depth map from camera)

    python depth_estimate_cam.py

    (Generate stereo image from image)

    python SBS_generate_image.py

    (Generate stereo image from camera)

    python SBS_generate_cam.py
  3. The resulting depth maps are written to the depth folder.

    The resulting stereo image are written to the stereo folder.

Acknowledgments

Our code builds upon Intel MiDaS