Portrait photo to Hologram all-in-one script
- iPhone/iPad
- PC (only needed for the initial setup)
- Looking Glass holographic display
- USB-C Digital AV Multiport Adapter (other adapters might work as well, but YMMV)
- Pythonista app
- Internet connection required for the first run. Subsequent usage is possible offline.
- Connect the Looking Glass display to a PC with HoloPlay service installed and visit https://eka.hn/calibration_test.html
- Copy the JSON block provided by the website and use it to replace the hardcoded calibration data on row 51 of
HoloPortrait.py
- Transfer
HoloPortrait.py
to Pythonista and run it with a Python 3.x interpreter - You will be asked to pick a photo that should be turned into a hologram. If you choose a photo that does not contain a depth map, the depth map will be automatically inferred using a machine learning model. This happens locally on your device, no data is ever sent anywhere.
- You can disable the ML inferrence by editing row 81 of
HoloPortrait.py
. In this mode you will be allowed to choose only from Portrait photos. If you don't own a device capable of taking Portrait photos, you can download one of the sample photos provided in this repository: Sample 1 Sample 2
See it in action here.
This is a second generation of HoloPortrait, made possible thanks to the driverless-HoloPlay.js library and iOS-LookingGlass browser. It performs 30x faster than the first generation and it offers additional improvements like switching between Mesh and Pointcloud modes. To read more about the Legacy version of the script, see README_legacy.md.
The Mesh code is based on a Custom Geometry example by threejsfundamentals.org.