{"id":13757478,"url":"https://github.com/complight/metameric_holography","last_synced_at":"2025-05-10T05:32:13.651Z","repository":{"id":105011644,"uuid":"409297712","full_name":"complight/metameric_holography","owner":"complight","description":":eye: Gaze-contingent varifocal phase-only holograms for holographic displays","archived":false,"fork":false,"pushed_at":"2022-05-29T20:09:55.000Z","size":38067,"stargazers_count":6,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-16T13:35:12.414Z","etag":null,"topics":["academic-paper","arxiv","computational-display","computer-generated-holography","holographic","holography","ieee-vr","odak"],"latest_commit_sha":null,"homepage":"https://complightlab.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/complight.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-09-22T17:32:44.000Z","updated_at":"2024-09-04T06:59:56.000Z","dependencies_parsed_at":"2023-04-04T10:17:05.793Z","dependency_job_id":null,"html_url":"https://github.com/complight/metameric_holography","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/complight%2Fmetameric_holography","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/complight%2Fmetameric_holography/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/complight%2Fmetameric_holography/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/complight%2Fmetameric_holography/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/complight","download_url":"https://codeload.github.com/complight/metameric_holography/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253371076,"owners_count":21897998,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["academic-paper","arxiv","computational-display","computer-generated-holography","holographic","holography","ieee-vr","odak"],"created_at":"2024-08-03T12:00:39.380Z","updated_at":"2025-05-10T05:32:09.788Z","avatar_url":"https://github.com/complight.png","language":"Python","funding_links":[],"categories":["Computer Generated Holography (CGH) Algorithms"],"sub_categories":["Iterative Methods"],"readme":"# Metameric Varifocal Holography\n[David R. Walton](https://drwalton.github.io),\n[Koray Kavaklı](https://www.linkedin.com/in/koray-kavakli-75949241/),\n[Rafael Kuffner Dos Anjos](https://eps.leeds.ac.uk/computing/staff/9770/dr-rafael-kuffner-dos-anjos),\n[David Swapp](http://www0.cs.ucl.ac.uk/people/D.Swapp.html),\n[Tim Weyrich](https://reality.cs.ucl.ac.uk/weyrich.html),\n[Hakan Ürey](https://mems.ku.edu.tr/),\n[Anthony Steed](https://wp.cs.ucl.ac.uk/anthonysteed/),\n[Tobias Ritschel](http://www.homepages.ucl.ac.uk/~ucactri/)\nand [Kaan Akşit](https://kaanaksit.com)\n\n\u003cimg src='https://github.com/complight/metameric_holography/raw/main/teaser.png' width=960\u003e\n\n[Project Page](https://vr.cs.ucl.ac.uk/research/pipelines/metameric-varifocal-holography/) | [Paper](https://arxiv.org/abs/2110.01981) | [Video](https://vimeo.com/623474853)\n\n# Description\n\nThis repository contains code related to the paper Metameric Varifocal Holography. It contains scripts to optimise varifocal holograms using metameric loss, or a variety of other possible loss functions. It also contains a blender script which can be used to render virtual images with depth of field with focus on a specified gaze location.\n\n# Installation\n\nThis repository makes use of the latest release of `odak`. To install this please use:\n\n`$ pip install odak`\n\nPlease ensure that you have installed version `0.1.9` or above.\n\nDepending on your environment, you may need to replace `pip` with `pip3` in the above.\n\nWe also make use of [pytorch](https://pytorch.org/get-started/locally/), `opencv2`, `matplotlib` and `numpy`. We recommend installing these with your package manager, `conda` or `pip` as appropriate.\n\n## Hardware requirements\n\nHologram generation on GPU using the current implementation of the metameric loss requires a significant amount of GPU memory. At 1920x1080 resolution we found that a 2080 Ti with 11GB of video RAM worked well, wheras at 1280x720 a 2070 card with 8GB of RAM was fine. The actual required memory may vary depending on other applications or OS use of the GPU.\n\n# Usage\n\n## Generating holograms\n\nTo run the hologram generation code, change your current directory to `code/varifocal_holograms` in this repository, and run `$ python main.py --setting [settings_file]` where `[settings_file]` is an appropriate `JSON`-formatted settings file. \n\nAn example settings file is provided at `code/varifocal_holograms/settings/default.txt`. It will process all images in the provided input directory.\n\nThe input directory should contain images and corresponding `JSON` metadata files, which contan information about the images. See `images/magazines` for an example. The only critical piece of information that must be correct in the `JSON` files for hologram generation is the `gaze_location`.\n\nThe important settings are as follows:\n\n* `general`\n    * `cuda`: 1 to use CUDA, 0 to use CPU.\n    * `gpu no`: Index of GPU to use, if CUDA is used.\n    * `iterations`: Iteration count to use to optimise each hologram.\n    * `propagation type`: Set to \"custom\" to use the optimised kernel described in the paper. Set to \"TR Fresnel\" to use an ideal kernel.\n    * `output directory`: Place where the holograms will be output to. Directory will be created if it does not already exist.\n    * `loss weights`: Controls the weighting of each of the implemented loss functions. See the comment above for information on which is which. Any loss set to 0.0 will not be computed.\n    * `region of interest`: Used to set a \"do not care\" region around the outside of the image, which can improve hologram quality.\n    * `learning rate`: Learning rate used by the optimiser (we use ADAM here).\n    * `hologram no`: Used for the temporal averaging application. To disable temporal averaging and produce only one hologram per input, set this to 1. For higher numbers, it will generate multiple holograms following the temporal averaging idea described in the paper.\n* `metameric`\n    * `real viewing distance`: The real distance of the viewer from the image plane. Units are arbitrary, but ensure the same units are used for `real image width`.\n    * `real image width`: Real width of the displayed image plane.\n* `dataset`\n    * `input directory`: Directory containing the images and `JSON` metadata files.\n    * `keys`: File extensions for the images and metadata files. Change this e.g. if you use `JPG` images.\n\n## Rendering DoF images\n\nThe blender script for rendering images with DoF is located in dataset_rendering. This script was written for blender 2.92 and may not work for earlier blender versions.\n\nTo use it, I recommend loading your scene in blender and switching to the \"scripting\" tab at the top of the screen. From here you can load the script into the text editor built into blender.\n\nSet up the scene as you would like, with the correct camera position. Set the gaze location at the bottom of the script. If desired, you can also use the script to render a grid of focal points or a focus sweep (see the comments in the code for how to do this).\n\nWhen setting the gaze location, it may be easiest to render a sample image as usual, then use the `dataset_rendering/find_image_point.py` script to select the gaze point you'd like and find its normalised image coordinates. Then copy \u0026 paste these into the script.\n\nRender the images by running the script with the \"play\" button at the top of the text editor.\n\nThis will generate an image and the corresponding `JSON` metadata file used by the hologram generation code.\n\n## Further help\n\nFor further help with this please contact us via the \"issues\" section.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomplight%2Fmetameric_holography","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomplight%2Fmetameric_holography","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomplight%2Fmetameric_holography/lists"}