{"id":43107063,"url":"https://github.com/raspberrypi/ai_enhance","last_synced_at":"2026-01-31T18:01:28.469Z","repository":{"id":335089080,"uuid":"1144096693","full_name":"raspberrypi/AI_enhance","owner":"raspberrypi","description":"Low light image enhancement using zero DCE neural network","archived":false,"fork":false,"pushed_at":"2026-01-28T12:58:51.000Z","size":401,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-29T02:46:03.875Z","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":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/raspberrypi.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-28T09:35:46.000Z","updated_at":"2026-01-28T12:58:55.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/raspberrypi/AI_enhance","commit_stats":null,"previous_names":["raspberrypi/ai_enhance"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/raspberrypi/AI_enhance","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspberrypi%2FAI_enhance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspberrypi%2FAI_enhance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspberrypi%2FAI_enhance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspberrypi%2FAI_enhance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raspberrypi","download_url":"https://codeload.github.com/raspberrypi/AI_enhance/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspberrypi%2FAI_enhance/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28949274,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T14:26:55.697Z","status":"ssl_error","status_checked_at":"2026-01-31T14:26:52.545Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-31T18:00:45.791Z","updated_at":"2026-01-31T18:01:28.463Z","avatar_url":"https://github.com/raspberrypi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI Enhance\n\nLow-light image enhancement using the Zero-DCE (Zero-Reference Deep Curve Estimation) algorithm.\n\n## Overview\n\nThis implementation enhances dark or low-light images by learning pixel-wise curve adjustments without requiring paired training data. The algorithm iteratively applies learned enhancement curves to brighten images while preserving natural appearance.\n\nBased on the paper: **\"Zero-Reference Deep Curve Estimation for Low-Light Image Enhancement\"** by Guo, Li et al. ([arXiv:2001.06826](https://arxiv.org/abs/2001.06826)), though this implementation does add some more explicit control of the target brightness based on the `gain` parameter (see below).\n\n### Zero-DCE Example\n\n| Before | After |\n|--------|-------|\n| ![Before](before.jpg) | ![After](after.jpg) |\n\n## Installation\n\nInstall the required Python packages:\n\n```bash\npip install numpy opencv-python pillow tqdm ai-edge-litert\n```\n\n## Usage\n\n```bash\npython enhance.py \u003cinput_image\u003e \u003coutput_image\u003e [options]\n```\n\n### Required Arguments\n\n- `input` - Path to the input image file\n- `output` - Path for the output enhanced image\n\n### Optional Arguments\n\n| Argument | Default | Description |\n|----------|---------|-------------|\n| `--model` | `dcenet.tflite` | Path to the model file. You may want to consider trying the `dcenet_int8.tflite` quantized model |\n| `--gain` | `1.0` | Brightness adjustment factor. Higher values produce brighter output |\n| `--local-strength` | `0.25` | Balance between local and global brightness (0.0-1.0). Higher values brighten dark areas more |\n| `--patch-size` | `256` | Patch size for processing. Use 0 for full image size. Smaller values reduce memory usage |\n| `--batch-size` | `1` | Number of patches to process simultaneously |\n| `--num-threads` | `4` | Number of CPU threads for inference |\n| `--overlap-pixels` | `16` | Pixel overlap between patches to reduce seam artifacts |\n| `--hide-progress` | `false` | Hide the progress bar during processing |\n| `--quality` | `95` | JPEG output quality (0-100). Higher values produce larger, higher quality files |\n| `--compress-level` | `1` | PNG compression level (0-9). Higher values produce smaller files but take longer |\n\n### Examples\n\nBasic usage:\n```bash\npython enhance.py dark_photo.jpg enhanced_photo.jpg\n```\n\nWith increased brightness:\n```bash\npython enhance.py dark_photo.jpg enhanced_photo.jpg --gain 1.3\n```\n\nLow memory usage (smaller patches):\n```bash\npython enhance.py large_image.jpg output.jpg --patch-size 128\n```\n\nUsing the int8 quantised model:\n```bash\npython enhance.py input.jpg output.jpg --model dcenet_int8.tflite\n```\n\n## Performance\n\nOn a Pi 5 the default `dcenet.tflite` model runs at somewhat less than 1 megapixel per second. The quantised `dcenet_int8.tflite` runs very roughly twice as fast, but produces different results (though not conspicuously so).\n\nPerformance will obviously be worse on lower specification Pis, and we don't recommend running the models on anything with less than 1GB of memory.\n\nIn practice, the `patch-size` and `batch-size` parameters make little difference to the run time, so the defaults should be acceptable for most use cases.\n\nThe models don't have to be run on Pis; you can run them on pretty much any computer.\n\n## License\n\nBSD 2-Clause License. See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraspberrypi%2Fai_enhance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraspberrypi%2Fai_enhance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraspberrypi%2Fai_enhance/lists"}