{"id":13737140,"url":"https://github.com/linzhiqiu/digital_chirality","last_synced_at":"2025-09-09T05:52:36.031Z","repository":{"id":75817990,"uuid":"227931679","full_name":"linzhiqiu/digital_chirality","owner":"linzhiqiu","description":"Testing the chirality of digital imaging operations.","archived":false,"fork":false,"pushed_at":"2020-06-17T15:18:49.000Z","size":1805,"stargazers_count":95,"open_issues_count":0,"forks_count":15,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T03:34:40.402Z","etag":null,"topics":["chirality","cvpr","cvpr-2020","cvpr2020","visual-chirality"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/linzhiqiu.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":"2019-12-13T22:22:34.000Z","updated_at":"2024-07-03T03:10:14.000Z","dependencies_parsed_at":"2023-06-07T20:15:11.077Z","dependency_job_id":null,"html_url":"https://github.com/linzhiqiu/digital_chirality","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/linzhiqiu/digital_chirality","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linzhiqiu%2Fdigital_chirality","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linzhiqiu%2Fdigital_chirality/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linzhiqiu%2Fdigital_chirality/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linzhiqiu%2Fdigital_chirality/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linzhiqiu","download_url":"https://codeload.github.com/linzhiqiu/digital_chirality/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linzhiqiu%2Fdigital_chirality/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274250508,"owners_count":25249396,"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","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["chirality","cvpr","cvpr-2020","cvpr2020","visual-chirality"],"created_at":"2024-08-03T03:01:35.995Z","updated_at":"2025-09-09T05:52:35.981Z","avatar_url":"https://github.com/linzhiqiu.png","language":"Jupyter Notebook","funding_links":[],"categories":["Jupyter Notebook"],"sub_categories":[],"readme":"# Visual Chirality (CVPR2020 Best Paper Nominee) [[www](http://bit.ly/visual-chirality)]\r\n\r\n## Introduction\r\nThis repository provides supplemental code of [*Visual Chirality*](http://bit.ly/visual-chirality) paper.\r\n\r\n\u003e [**Visual Chirality**](http://bit.ly/visual-chirality),            \r\n\u003e [Zhiqiu Lin](https://linzhiqiu.github.io), [Jin Sun](http://www.cs.cornell.edu/~jinsun/), \r\n[Abe Davis](http://abedavis.com), [Noah Snavely](https://www.cs.cornell.edu/~snavely/)     \r\n\u003e *IEEE Computer Vision and Pattern Recognition, 2020, Oral Presentation* \r\n\r\nFor a brief overview of the paper, please check out our oral presentation video!\r\n\u003cp align=\"center\"\u003e\u003ca target=_blank href=\"https://www.youtube.com/watch?v=gc5IvTozU9M\u0026feature=youtu.be\"\u003e\u003cimg src=\"http://img.youtube.com/vi/gc5IvTozU9M/0.jpg\" width=\"50%\" alt=\"\" /\u003e\u003c/a\u003e\u003c/p\u003e\r\n\r\n\r\n## Repository Overview\r\n\r\nThis repository contains all the code and experiments that appear in the supplemental material of our paper for reproducibility.\r\n\r\nIn specific, we provide a jupyter notebook [`CommutativeTestDemo.ipynb`](CommutativeTestDemo.ipynb) for both **commutative tests** and **glide commutative tests** between mirror reflection and several imaging operations, including bayer-demosaicing, JPEG compression, and their composition.\r\n\u003cp align=\"center\"\u003e\u003cimg src=\"images/example_test.png\" width=\"90%\" alt=\"\"/\u003e\u003c/p\u003e\r\n\r\nWe also provide a PyTorch implementation of the learning experiments that predict the random horizontal reflections of synthetic processed images.\r\n\u003cp align=\"center\"\u003e\u003cimg src=\"images/random_processed.png\" width=\"50%\" alt=\"\"/\u003e\u003c/p\u003e\r\n\r\n## Commutative Test\r\nPlease open and run jupyter notebook [`CommutativeTestDemo.ipynb`](CommutativeTestDemo.ipynb) for details.\r\n\r\n## Learning Experiments on Synthetic Images\r\n- `train.py`: includes training and validation scripts.\r\n- `config.py`: contains arguments for data preparation, model definition, and imaging details.\r\n- `exp.sh` : contains the experiments script to run.\r\n- All other helper modules :\r\n  - `dataset_factory.py`: prepares PyTorch dataloaders of processed images.\r\n  - `global_setting.py`: contains all supporting demosaicing algorithms and model definitions.\r\n  - `utils.py`: contains functions to generate random images and compute mosiaced/demosaiced/compressed images.\r\n  - `tools.py`: A variety of helpers to get PyTorch optimizer/schedular and logging directory names.\r\n\r\nThe code is developed using python 3.6.10. NVIDIA GPUs are needed to train and test.\r\nIt is suggested to use anaconda to install any dependecies required in this repo.\r\n\r\n\r\n#### Learning Results without random cropping\r\n\r\nThe below table is the results of the synthetic processed images experiments using random gaussian images of different dimensions as well as various processing methods (**without random cropping**). Please refer to our supplemental material for details about training. All the test results followed the prediction of the commutative tests in [`CommutativeTestDemo.ipynb`](CommutativeTestDemo.ipynb).\r\n\r\n| Image Processing | Image Size | Test Accuracy  |  \r\n|------------------|------------|----------------|\r\n| Bayer-Demosaicing| 99         | 50%  |\r\n| JPEG Compression | 99         | 99%  | \r\n| Both             | 99         | 99%  |  \r\n| Bayer-Demosaicing| 100         | 99%  |\r\n| JPEG Compression | 100         | 99%  | \r\n| Both             | 100         | 99%  |  \r\n| Bayer-Demosaicing| 112         | 99%  |\r\n| JPEG Compression | 112         | 50%  | \r\n| Both             | 112         | 99%  |  \r\n\r\n#### Learning Results with random cropping\r\n\r\nWith **random cropping**, we can still train network to predict random horizontal reflections on Bayer-demosaiced + JPEG compressed randomly generated gaussian images. We use a cropping size of 512, and in order to eliminate the chance of the network cheating by utilizing the boundary of images (e.g., JPEG edge artifacts), we crop from the center (544, 544) of (576, 576) images. The results again followed our prediction in paper, and they are shown in the following table:\r\n\r\n| Image Processing | Image Size | Crop Size| Test Accuracy  |  \r\n|------------------|------------|----|----------------|\r\n| Bayer-Demosaicing| 576 |    512    | 50%  |\r\n| JPEG Compression | 576 |    512    | 50%  | \r\n| **Both**             | **576** |    **512**   | **99%**  |  \r\n\r\n### Citation\r\nIf this work is useful for your research, please cite our paper:\r\n```\r\n@InProceedings{chirality20,\r\n  title={Visual Chirality},\r\n  author = {Zhiqiu Lin and Jin Sun and Abe Davis and Noah Snavely},\r\n  booktitle={Computer Vision and Pattern Recognition (CVPR)},\r\n  year={2020}\r\n}\r\n```\r\n\r\n### License\r\nThis code is freely available for free non-commercial use, and may be redistributed under these conditions. \r\nThird-party datasets and softwares are subject to their respective licenses. \r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinzhiqiu%2Fdigital_chirality","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinzhiqiu%2Fdigital_chirality","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinzhiqiu%2Fdigital_chirality/lists"}