{"id":19025999,"url":"https://github.com/ruhyadi/image-enchancement","last_synced_at":"2026-05-18T14:03:20.335Z","repository":{"id":107410690,"uuid":"509736744","full_name":"ruhyadi/image-enchancement","owner":"ruhyadi","description":"Image Enchancement with OpenCV and GAN","archived":false,"fork":false,"pushed_at":"2022-07-06T12:33:19.000Z","size":5043,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-02T02:24:11.186Z","etag":null,"topics":["gan","image-enhancement","opencv"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ruhyadi.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-02T11:26:46.000Z","updated_at":"2022-07-06T12:02:59.000Z","dependencies_parsed_at":"2023-05-17T10:15:31.531Z","dependency_job_id":null,"html_url":"https://github.com/ruhyadi/image-enchancement","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruhyadi%2Fimage-enchancement","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruhyadi%2Fimage-enchancement/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruhyadi%2Fimage-enchancement/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruhyadi%2Fimage-enchancement/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruhyadi","download_url":"https://codeload.github.com/ruhyadi/image-enchancement/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240072131,"owners_count":19743526,"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":["gan","image-enhancement","opencv"],"created_at":"2024-11-08T20:47:06.828Z","updated_at":"2026-04-30T12:30:18.410Z","avatar_url":"https://github.com/ruhyadi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# Image Enchanment\n\n\u003ca href=\"https://www.python.org/\"\u003e\u003cimg alt=\"Python\" src=\"https://img.shields.io/badge/-Python 3.8+-blue?style=flat\u0026logo=python\u0026logoColor=white\"\u003e\u003c/a\u003e\n\u003ca href=\"https://pytorch.org/get-started/locally/\"\u003e\u003cimg alt=\"PyTorch\" src=\"https://img.shields.io/badge/-PyTorch 1.8+-red?style=flat\u0026logo=pytorch\u0026logoColor=white\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opencv.org/\"\u003e\u003cimg alt=\"PyTorch\" src=\"https://img.shields.io/badge/-OpenCV 4.4.0+-green?style=flat\u0026logo=opencv\u0026logoColor=white\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/XPixelGroup/BasicSR\"\u003e\u003cimg alt=\"Code style: black\" src=\"https://img.shields.io/badge/BasicSR-v1.3.5-purple.svg?style=flat\u0026labelColor=gray\"\u003e\u003c/a\u003e\n\n\u003c/div\u003e\n\n## ⚠️\u0026nbsp;\u0026nbsp;Cautions\n\u003e This repository currently under development\n\n## 📼\u0026nbsp;\u0026nbsp;Demo\n\u003cdiv align=\"center\"\u003e\n\n![demo](assets/demo.gif)\n\n\u003c/div\u003e\n\n## 📌\u0026nbsp;\u0026nbsp;Introduction\n\nThis repository is used for assessment purposes in the image enhancement task. There are two types of enhancements used:\n\n- Enhancement using OpenCV Python\n- Enhancement using GAN (Generative Adversarial Network) and OpenCV Python\n\n## 🚀\u0026nbsp;\u0026nbsp;Quickstart\n\u003e In using this repository, it is recommended to use a virtual environment (**Anaconda**).\n\n### 💎\u0026nbsp;\u0026nbsp;Installation\n\u003e The steps will install the required dependencies\n\n1. Clone repository\n```bash\ngit clone https://github.com/ruhyadi/assessment-image-enchancment\n```\n2. Install requirements inside Virtual Env (details in [miniconda](https://docs.conda.io/en/latest/miniconda.html))\n```bash\ncd assessment-image-enchancment\npip install -r requirements.txt\n```\n3. Install **BasicSR**\n```bash\ncd BasicSR\npython setup.py develop\n```\n4. Download ESRGAN Pretrained Model\n```bash\npython scripts/download_pretrained_models.py ESRGAN\n```\n\n### 🍿\u0026nbsp;\u0026nbsp;Inference\n\n#### 🥊\u0026nbsp;\u0026nbsp;Enchancement with OpenCV\nI have provided a GUI application that can be used for this purpose. The application can be accessed by:\n```bash\nstreamlit run app.py\n```\nIn the application you can input **the input image** and **the ground-truth image**. The application will process the image into an intermediate image and an output image. Inside the application there are sliders and buttons that can be combined to produce the best enhancement results.\nFor details see the demo section.\n\nThe enhancement function can also be accessed via `enhancement.py`scripts:\n```bash\npython enhancement.py \\\n  --img_path /assets/input.png \\\n  --inter_path /assets/intermediate.png \\\n  --output_path /assets/results.png \\\n  --alpha 1.5 \\\n  --beta -0.5 \\\n  --ksize 11 \\\n  --threshold 170 \\\n  --clahe \\\n  --clahe_cliplimit 2.0 \\\n  --equalizer\n```\nwith the help:\n```bash\nusage: enhancement.py [-h] [--img_path IMG_PATH] [--inter_path INTER_PATH] [--output_path OUTPUT_PATH] [--equalizer] [--clahe]\n                      [--clahe_cliplimit CLAHE_CLIPLIMIT] [--alpha ALPHA] [--beta BETA] [--ksize KSIZE] [--threshold THRESHOLD]\n\nImage enhancement\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --img_path IMG_PATH   Path to image\n  --inter_path INTER_PATH\n                        Path to intermediate image\n  --output_path OUTPUT_PATH\n                        Path to output image\n  --equalizer           Equalize histogram\n  --clahe               CLAHE\n  --clahe_cliplimit CLAHE_CLIPLIMIT\n                        CLAHE clip limit\n  --alpha ALPHA         Alpha\n  --beta BETA           Beta\n  --ksize KSIZE         Ksize\n  --threshold THRESHOLD\n                        Threshold\n```\n\n#### 🎯\u0026nbsp;\u0026nbsp;Generative Adversarial Network (GAN)\nEnhancement can also use GAN. The GAN function here **does not directly** get the thresholding of the image, but as an intermediate for upscaling the image first. The GAN command can be executed with:\n\n```bash\npython BasicSR/inference/inference_esrgan.py \\\n  --model_path BasicSR/experiments/pretrained_models/ESRGAN/ESRGAN_SRx4_DF2KOST_official-ff704c30.pth \\\n  --input assets\n```\n\nThe results of upscaling the image using GAN can be seen in the table below:\n\n|Input Image|GAN Results|\n|:--:|:--:|\n|![head](assets/head.png)|![head-gan](assets/head_ESRGAN.png)|\n|![before](assets/input.png)|![output](assets/001_ESRGAN.png)|\n\nThe results of the GAN look not very effective for the image in the second row, this is because the GAN is very dependent on the image data being trained, maybe the training data itself does not have the same image as the second row.\n\n\n## ❤️\u0026nbsp;\u0026nbsp;Acknowledgement\n\n- [OpenCV](https://github.com/opencv/opencv)\n- [BasicSR](https://github.com/XPixelGroup/BasicSR)\n```\n@misc{wang2020basicsr,\n  author =       {Xintao Wang and Ke Yu and Kelvin C.K. Chan and\n                  Chao Dong and Chen Change Loy},\n  title =        {{BasicSR}: Open Source Image and Video Restoration Toolbox},\n  howpublished = {\\url{https://github.com/xinntao/BasicSR}},\n  year =         {2018}\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruhyadi%2Fimage-enchancement","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruhyadi%2Fimage-enchancement","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruhyadi%2Fimage-enchancement/lists"}