{"id":19767720,"url":"https://github.com/compphoto/intrinsicflashphotography","last_synced_at":"2025-04-30T16:34:02.525Z","repository":{"id":187396123,"uuid":"614104866","full_name":"compphoto/IntrinsicFlashPhotography","owner":"compphoto","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-27T03:10:48.000Z","size":4860,"stargazers_count":14,"open_issues_count":2,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-06T03:05:42.888Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/compphoto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-03-14T22:43:13.000Z","updated_at":"2024-12-27T09:34:31.000Z","dependencies_parsed_at":"2023-08-10T07:31:26.054Z","dependency_job_id":null,"html_url":"https://github.com/compphoto/IntrinsicFlashPhotography","commit_stats":null,"previous_names":["compphoto/intrinsicflashphotography"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compphoto%2FIntrinsicFlashPhotography","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compphoto%2FIntrinsicFlashPhotography/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compphoto%2FIntrinsicFlashPhotography/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compphoto%2FIntrinsicFlashPhotography/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/compphoto","download_url":"https://codeload.github.com/compphoto/IntrinsicFlashPhotography/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251742793,"owners_count":21636511,"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":[],"created_at":"2024-11-12T04:32:02.513Z","updated_at":"2025-04-30T16:34:00.565Z","avatar_url":"https://github.com/compphoto.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Computational Flash Photography through Intrinsics\r\n![teaser](./figures/teaser_transparent.png)\r\n\r\nWe develop a system to computationally control the flash light in photographs originally taken with or without flash. We formulate the flash photograph formation through image intrinsics, and estimate the flash shading through generation for no-flash photographs (top) or decomposition where we separate the flash from the ambient illumination for flash photographs (bottom).\r\n\r\nProject web page: http://yaksoy.github.io/intrinsicFlash\r\n\r\nExtended Flash and Ambient Illuminations Dataset repo: https://github.com/compphoto/IntrinsicFlashDataset\r\n\r\n## Setup\r\nWe provide training implementation of our method for both the generation and decomposition of flash through intrinsics.\r\n\r\n### Environments\r\nOur model can be trained using python 3.9 or higher versions.\r\n\r\nDownload our models weights from [here](https://vault.sfu.ca/index.php/s/sRWFTyRkirFEw6B) and put it in a directory called checkpoints.\r\n\r\nInstall the following dependencies:\r\n```sh\r\nconda install pytorch torchvision pytorch-cuda=11.6 -c pytorch -c nvidia\r\nconda install matplotlib\r\nconda install scipy\r\nconda install scikit-image\r\nconda install -c conda-forge pymatreader\r\nconda install -c conda-forge dominate\r\nconda install -c conda-forge timm\r\npip install opencv-python\r\n\r\n```\r\n\r\n### Training\r\nNavigate to [dataset preparation instructions](./dataset_prepare/) to download and prepare the training dataset. \r\n\r\nFor decomposition:\r\n```sh\r\npython train.py --dataroot DATASETDIR --name flashDecomposition --model intrinsic_flash_decomposition  --normalize_flash 1 --normalize_ambient 1   \r\n```\r\nFor generation:\r\n```sh\r\npython train.py --dataroot DATASETDIR --name flashGeneration --model intrinsic_flash_generation  --normalize_flash 1 --normalize_ambient 1  \r\n```\r\n\r\n\r\n### Evaluation\r\nFor decomposition:\r\n```sh\r\npython test.py --dataroot DATASETDIR --name flashDecomposition --model intrinsic_flash_decomposition  --normalize_flash 1 --normalize_ambient 1 --eval \r\n```\r\nFor generation:\r\n```sh\r\npython test.py --dataroot DATASETDIR --name flashGeneration --model intrinsic_flash_generation  --normalize_flash 1 --normalize_ambient 1  --eval\r\n```\r\n\r\n\r\n## Citation\r\nThis implementation is provided for academic use only. \r\n```\r\n@INPROCEEDINGS{maralan2023flash,\r\n  author={Sepideh Sarajian Maralan and Chris Careaga and Ya\\u{g}{\\i}z Aksoy},\r\n  title={Computational Flash Photography through Intrinsics},\r\n  journal={Proc. CVPR},\r\n  year={2023}\r\n}\r\n```\r\n\r\nPlease cite our paper if you use this code, dataset or any of the models.\r\n## Credits\r\nThe training skeleton is adapted from the [pytorch-CycleGAN-and-pix2pix][4] repository.\r\n\r\nThe network architecture is adapted from the [MiDaS][1] repository.\r\n\r\n[1]: https://github.com/intel-isl/MiDaS/tree/v2\r\n[4]: https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompphoto%2Fintrinsicflashphotography","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompphoto%2Fintrinsicflashphotography","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompphoto%2Fintrinsicflashphotography/lists"}