{"id":27923304,"url":"https://github.com/p1sangmas/re-ddcolor","last_synced_at":"2026-02-28T10:02:00.305Z","repository":{"id":291599809,"uuid":"978122124","full_name":"p1sangmas/re-DDColor","owner":"p1sangmas","description":"An improved version of DDColor with enhanced performance and usability. This project extends the original framework with Apple Metal support, interactive web UI, video colorization capabilities, and cross-platform optimization.","archived":false,"fork":false,"pushed_at":"2025-05-06T04:05:34.000Z","size":35249,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"ddcolor-development","last_synced_at":"2025-07-20T16:41:11.650Z","etag":null,"topics":["computer-vision","image-colorization","pytorch","video-colorization"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/p1sangmas.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}},"created_at":"2025-05-05T13:59:52.000Z","updated_at":"2025-06-09T03:15:58.000Z","dependencies_parsed_at":"2025-05-06T22:31:34.776Z","dependency_job_id":null,"html_url":"https://github.com/p1sangmas/re-DDColor","commit_stats":null,"previous_names":["p1sangmas/re-ddcolor"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/p1sangmas/re-DDColor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p1sangmas%2Fre-DDColor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p1sangmas%2Fre-DDColor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p1sangmas%2Fre-DDColor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p1sangmas%2Fre-DDColor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/p1sangmas","download_url":"https://codeload.github.com/p1sangmas/re-DDColor/tar.gz/refs/heads/ddcolor-development","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p1sangmas%2Fre-DDColor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270235471,"owners_count":24550184,"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-08-13T02:00:09.904Z","response_time":66,"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":["computer-vision","image-colorization","pytorch","video-colorization"],"created_at":"2025-05-06T22:30:39.425Z","updated_at":"2026-02-28T10:01:55.243Z","avatar_url":"https://github.com/p1sangmas.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# re-DDColor: Enhanced Image Colorization\n\nA revised and improved version of [DDColor](https://github.com/piddnad/DDColor), offering additional features and optimizations for image colorization.\n\n**This project is developed as part of my Bachelor of Computer Engineering with Honours Final Year Project (2025).**\n\n[![License](https://img.shields.io/github/license/piddnad/DDColor)](LICENSE)\n\n## Overview\n\nDDColor is a state-of-the-art automatic image colorization framework proposed in the paper \"DDColor: Towards Photo-Realistic Image Colorization via Dual Decoders\" (ICCV 2023). This revised version maintains the core functionality while adding new features, optimizing performance, and improving user interfaces.\n\n## Example Results\n\nBelow is a comparison of the input black-and-white images and the colorized outputs generated by re-DDColor:\n\n| **Before** (Black \u0026 White) | **After** (Colorized) |\n|-----------------------------|-----------------------|\n| ![Before](./assets/test_images/malaysia5.jpg) | ![After](./colorize_output/malaysia5.jpg) |\n\nYou can try colorizing your own images using the methods described in the [Usage](#usage) section.\n\n## New Features in This Version\n\n### Performance Improvements\n- Added support for Apple Metal Performance Shaders (MPS) for better performance on Mac devices\n- Optimized memory usage for improved processing on devices with limited resources\n- Enhanced inference pipeline for faster colorization\n\n### Interface Enhancements\n- **Gradio Web UI**: Added interactive web interface for easy colorization with before/after slider comparison\n- **Flask API**: Implemented a REST API for integration with other applications\n- **Video Processing**: Extended support for colorizing videos frame by frame\n- **Improved CLI**: Enhanced command-line interface with more options and better feedback\n\n### Technical Improvements\n- Better cross-platform compatibility (Windows, macOS, Linux)\n- Streamlined installation process with clearer dependencies\n- Additional model configuration options\n- Enhanced error handling and recovery\n- Comprehensive documentation\n\n## Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/yourusername/re-DDColor.git\ncd re-DDColor\n\n# Install dependencies\npip install -r requirements.txt\n\n# Download pre-trained models (automatically done on first run)\npython pretraindownload.py\n```\n\n## Docker Implementation\n\nFor the easiest and most consistent experience across different platforms, you can use Docker:\n\n```bash\n# Build the Docker image\ndocker build -t ddcolor-app .\n\n# Run the container\ndocker run -p 8501:8501 ddcolor-app\n\n# Access the web application\n# Open http://localhost:8501 in your browser\n```\n\n### Advantages of using Docker:\n- No need to install dependencies manually\n- Works consistently across Windows, macOS, and Linux\n- Model is downloaded automatically during the build process\n- All required libraries are pre-configured\n\n### Requirements:\n- Docker installed on your system ([Get Docker](https://docs.docker.com/get-docker/))\n- At least 2GB of free disk space\n\n## Usage\n\n### Web Interface (Gradio)\n\nThe easiest way to use re-DDColor is through the Gradio web interface:\n\n```bash\npython gradio_app.py\n```\n\nThis will start a local web server with an interactive UI where you can:\n- Upload black and white images\n- View colorization results with a before/after slider\n- Download the colorized images\n\n### REST API (Flask)\n\nFor integration with other applications:\n\n```bash\npython flaskapi.py\n```\n\nThe API will be available at `http://localhost:5000/` with the following endpoints:\n- `POST /colorize`: Upload an image for colorization\n- `GET /models`: List available models\n\n### Command Line\n\nFor batch processing or scripting:\n\n```bash\n# Colorize a single image\npython predict.py --input path/to/image.jpg --output path/to/output.jpg\n\n# Colorize all images in a directory\npython predict.py --input path/to/input_dir --output path/to/output_dir\n\n# Specify a different model\npython predict.py --input image.jpg --output output.jpg --model ddcolor_artistic.pth\n```\n\n### Video Colorization\n\nTo colorize videos:\n\n```bash\npython video_converter.py --input path/to/video.mp4 --output path/to/colorized_video.mp4\n```\n\n## Available Models\n\nre-DDColor includes several pre-trained models as described in [MODEL_ZOO.md](MODEL_ZOO.md):\n\n| Model | Description | Best For |\n|-------|-------------|----------|\n| `ddcolor_modelscope.pth` (default) | DDColor-L with cleaned data | General use, best quality |\n| `ddcolor_paper.pth` | Original paper model | Paper reproduction |\n| `ddcolor_artistic.pth` | Trained with artistic images | Creative colorization, fewer artifacts |\n| `ddcolor_paper_tiny.pth` | Lightweight model | Resource-constrained devices |\n\n## Technical Details\n\n### Architecture\n\nre-DDColor uses a dual-decoder architecture:\n\n1. **Encoder**: ConvNeXt-based (tiny or large variants)\n2. **Decoder**: Two options:\n   - `MultiScaleColorDecoder`: Transformer-based decoder with multi-scale features\n   - `SingleColorDecoder`: Simpler decoder for faster inference\n3. **Color Processing**: Lab color space for accurate colorization\n\n### System Requirements\n\n- Python 3.7+\n- PyTorch 1.7+\n- CUDA-compatible GPU (recommended) or Apple Silicon\n- 4GB+ VRAM for large models, 2GB+ for tiny models\n\n## Training Your Own Model\n\nTo train a custom model:\n\n```bash\n# Edit the configuration\n# Modify options/train/train_ddcolor.yml with your dataset paths and parameters\n\n# Start training\npython basicsr/train.py -opt options/train/train_ddcolor.yml\n```\n\nSee the training configuration file for details on available options including loss functions, optimizers, and data augmentation.\n\n## Citation\n\nIf you use this code in your research, please cite the original DDColor paper:\n\n```bibtex\n@inproceedings{kang2023ddcolor,\n  title={DDColor: Towards Photo-Realistic Image Colorization via Dual Decoders},\n  author={Kang, Xiaoyang and Yang, Tao and Ouyang, Wenqi and Ren, Peiran and Li, Lingzhi and Xie, Xuansong},\n  booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision},\n  year={2023}\n}\n```\n\n## Acknowledgements\n\nThis work is a revised version of the original [DDColor](https://github.com/piddnad/DDColor) project by Xiaoyang Kang et al. I thank the original authors for their outstanding contribution to the field of image colorization.\n\n## License\n\nThis project is licensed under the terms of the LICENSE file included in the repository.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp1sangmas%2Fre-ddcolor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fp1sangmas%2Fre-ddcolor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp1sangmas%2Fre-ddcolor/lists"}