[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"tool-aiff22--DPED":3,"similar-aiff22--DPED":89},{"id":4,"github_repo":5,"name":6,"description_en":7,"description_zh":8,"ai_summary_zh":8,"readme_en":9,"readme_zh":10,"quickstart_zh":11,"use_case_zh":12,"hero_image_url":13,"owner_login":14,"owner_name":15,"owner_avatar_url":16,"owner_bio":17,"owner_company":17,"owner_location":17,"owner_email":17,"owner_twitter":17,"owner_website":17,"owner_url":18,"languages":19,"stars":24,"forks":25,"last_commit_at":26,"license":17,"difficulty_score":27,"env_os":28,"env_gpu":29,"env_ram":30,"env_deps":31,"category_tags":41,"github_topics":44,"view_count":53,"oss_zip_url":17,"oss_zip_packed_at":17,"status":54,"created_at":55,"updated_at":56,"faqs":57,"releases":88},6460,"aiff22\u002FDPED","DPED","Software and pre-trained models for automatic photo quality enhancement using Deep Convolutional Networks","DPED 是一款基于深度卷积神经网络的开源项目，旨在将普通手机拍摄的照片自动提升至单反相机般的画质。它主要解决了移动设备因传感器限制导致的照片噪点多、动态范围低及细节缺失等痛点，通过端到端的深度学习模型，让日常随手拍也能拥有专业级的色彩、纹理和清晰度。\n\n该项目非常适合计算机视觉领域的研究人员、AI 开发者以及希望深入理解图像增强算法的技术爱好者使用。虽然普通用户无法直接通过图形界面操作，但开发者可基于其提供的预训练模型（针对 iPhone、黑莓和索尼等不同设备优化）快速集成到自己的应用中，或利用其代码进行二次开发和训练。\n\nDPED 的核心技术亮点在于其创新的损失函数设计，它巧妙地结合了内容损失、颜色损失、纹理对抗损失以及全变分损失，在提升画质的同时有效避免了传统算法常见的伪影和过度平滑问题。此外，该模型具有良好的泛化能力，不仅支持任意分辨率的图像输入，其方法论还可推广至各类数字相机，为移动端摄影后期处理提供了强有力的技术支撑。","## DSLR-Quality Photos on Mobile Devices with Deep Convolutional Networks\n\n\u003Cbr\u002F>\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Faiff22_DPED_readme_d3bc4742075d.jpg\"\u002F>\n\n\u003Cbr\u002F>\n\n#### 1. Overview [[Paper]](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1704.02470.pdf) [[Project webpage]](https:\u002F\u002Faiff22.github.io\u002F) [[Enhancing RAW photos]](https:\u002F\u002Fgithub.com\u002Faiff22\u002FPyNET) [[Rendering Bokeh Effect]](https:\u002F\u002Fgithub.com\u002Faiff22\u002FPyNET-Bokeh)\n\nThe provided code implements the paper that presents an end-to-end deep learning approach for translating ordinary photos from smartphones into DSLR-quality images. The learned model can be applied to photos of arbitrary resolution, while the methodology itself is generalized to \nany type of digital camera. More visual results can be found [here](https:\u002F\u002Faiff22.github.io\u002F#demo).\n\n\n#### 2. Prerequisites\n\n- Python + Pillow, scipy, numpy, imageio packages\n- [TensorFlow 1.x \u002F 2.x](https:\u002F\u002Fwww.tensorflow.org\u002Finstall\u002F) + [CUDA CuDNN](https:\u002F\u002Fdeveloper.nvidia.com\u002Fcudnn)\n- Nvidia GPU\n\n\n#### 3. First steps\n\n- Download the pre-trained [VGG-19 model](https:\u002F\u002Fdownload.ai-benchmark.com\u002Fs\u002FCCDiWM2sE25x2dW\u002Fdownload\u002Fimagenet-vgg-verydeep-19.mat) and put it into `vgg_pretrained\u002F` folder\n- Download [DPED dataset](https:\u002F\u002Faiff22.github.io\u002F#dataset) (patches for CNN training) and extract it into `dped\u002F` folder.  \n\u003Csub>This folder should contain three subolders: `sony\u002F`, `iphone\u002F` and `blackberry\u002F`\u003C\u002Fsub>\n\n\u003Cbr\u002F>\n\n#### 4. Train the model\n\n```bash\npython train_model.py model=\u003Cmodel>\n```\n\nObligatory parameters:\n\n>```model```: **```iphone```**, **```blackberry```** or **```sony```**\n\nOptional parameters and their default values:\n\n>```batch_size```: **```50```** &nbsp; - &nbsp; batch size [smaller values can lead to unstable training] \u003Cbr\u002F>\n>```train_size```: **```30000```** &nbsp; - &nbsp; the number of training patches randomly loaded each ```eval_step``` iterations \u003Cbr\u002F>\n>```eval_step```: **```1000```** &nbsp; - &nbsp; each ```eval_step``` iterations the model is saved and the training data is reloaded \u003Cbr\u002F>\n>```num_train_iters```: **```20000```** &nbsp; - &nbsp; the number of training iterations \u003Cbr\u002F>\n>```learning_rate```: **```5e-4```** &nbsp; - &nbsp; learning rate \u003Cbr\u002F>\n>```w_content```: **```10```** &nbsp; - &nbsp; the weight of the content loss \u003Cbr\u002F>\n>```w_color```: **```0.5```** &nbsp; - &nbsp; the weight of the color loss \u003Cbr\u002F>\n>```w_texture```: **```1```** &nbsp; - &nbsp; the weight of the texture [adversarial] loss \u003Cbr\u002F>\n>```w_tv```: **```2000```** &nbsp; - &nbsp; the weight of the total variation loss \u003Cbr\u002F>\n>```dped_dir```: **```dped\u002F```** &nbsp; - &nbsp; path to the folder with DPED dataset \u003Cbr\u002F>\n>```vgg_dir```: **```vgg_pretrained\u002Fimagenet-vgg-verydeep-19.mat```** &nbsp; - &nbsp; path to the pre-trained VGG-19 network \u003Cbr\u002F>\n\nExample:\n\n```bash\npython train_model.py model=iphone batch_size=50 dped_dir=dped\u002F w_color=0.7\n```\n\n\u003Cbr\u002F>\n\n#### 5. Test the provided pre-trained models\n\n```bash\npython test_model.py model=\u003Cmodel>\n```\n\nObligatory parameters:\n\n>```model```: **```iphone_orig```**, **```blackberry_orig```** or **```sony_orig```**\n\nOptional parameters:\n\n>```test_subset```: **```full```**,**```small```**  &nbsp; - &nbsp; all 29 or only 5 test images will be processed \u003Cbr\u002F>\n>```resolution```: **```orig```**,**```high```**,**```medium```**,**```small```**,**```tiny```** &nbsp; - &nbsp; the resolution of the test images [**```orig```** means original resolution]\u003Cbr\u002F>\n>```use_gpu```: **```true```**,**```false```** &nbsp; - &nbsp; run models on GPU or CPU \u003Cbr\u002F>\n>```dped_dir```: **```dped\u002F```** &nbsp; - &nbsp; path to the folder with DPED dataset \u003Cbr\u002F>\n\nExample:\n\n```bash\npython test_model.py model=iphone_orig test_subset=full resolution=orig use_gpu=true\n```\n\n\u003Cbr\u002F>\n\n#### 6. Test the obtained models\n\n```bash\npython test_model.py model=\u003Cmodel>\n```\n\nObligatory parameters:\n\n>```model```: **```iphone```**, **```blackberry```** or **```sony```**\n\nOptional parameters:\n\n>```test_subset```: **```full```**,**```small```**  &nbsp; - &nbsp; all 29 or only 5 test images will be processed \u003Cbr\u002F>\n>```iteration```: **```all```** or **```\u003Cnumber>```**  &nbsp; - &nbsp; get visual results for all iterations or for the specific iteration,  \n>&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;**```\u003Cnumber>```** must be a multiple of ```eval_step``` \u003Cbr\u002F>\n>```resolution```: **```orig```**,**```high```**,**```medium```**,**```small```**,**```tiny```** &nbsp; - &nbsp; the resolution of the test \nimages [**```orig```** means original resolution]\u003Cbr\u002F>\n>```use_gpu```: **```true```**,**```false```** &nbsp; - &nbsp; run models on GPU or CPU \u003Cbr\u002F>\n>```dped_dir```: **```dped\u002F```** &nbsp; - &nbsp; path to the folder with DPED dataset \u003Cbr\u002F>  \n\nExample:\n\n```bash\npython test_model.py model=iphone iteration=13000 test_subset=full resolution=orig use_gpu=true\n```\n\u003Cbr\u002F>\n\n#### 7. Folder structure\n\n>```dped\u002F```              &nbsp; - &nbsp; the folder with the DPED dataset \u003Cbr\u002F>\n>```models\u002F```            &nbsp; - &nbsp; logs and models that are saved during the training process \u003Cbr\u002F>\n>```models_orig\u002F```       &nbsp; - &nbsp; the provided pre-trained models for **```iphone```**, **```sony```** and **```blackberry```** \u003Cbr\u002F>\n>```results\u002F```           &nbsp; - &nbsp; visual results for small image patches that are saved while training \u003Cbr\u002F>\n>```vgg-pretrained\u002F```    &nbsp; - &nbsp; the folder with the pre-trained VGG-19 network \u003Cbr\u002F>\n>```visual_results\u002F```    &nbsp; - &nbsp; processed [enhanced] test images \u003Cbr\u002F>\n\n>```load_dataset.py```    &nbsp; - &nbsp; python script that loads training data \u003Cbr\u002F>\n>```models.py```          &nbsp; - &nbsp; architecture of the image enhancement [resnet] and adversarial networks \u003Cbr\u002F>\n>```ssim.py```            &nbsp; - &nbsp; implementation of the ssim score \u003Cbr\u002F>\n>```train_model.py```     &nbsp; - &nbsp; implementation of the training procedure \u003Cbr\u002F>\n>```test_model.py```      &nbsp; - &nbsp; applying the pre-trained models to test images \u003Cbr\u002F>\n>```utils.py```           &nbsp; - &nbsp; auxiliary functions \u003Cbr\u002F>\n>```vgg.py```             &nbsp; - &nbsp; loading the pre-trained vgg-19 network \u003Cbr\u002F>\n\n\u003Cbr\u002F>\n\n#### 8. Problems and errors\n\n```\nWhat if I get an error: \"OOM when allocating tensor with shape [...]\"?\n```\n\n&nbsp;&nbsp; Your GPU does not have enough memory. If this happens during the training process:\n\n- Decrease the size of the training batch [```batch_size```]. Note however that smaller values can lead to unstable training.\n\n&nbsp;&nbsp; If this happens while testing the models:\n\n- Run the model on CPU (set the parameter ```use_gpu``` to **```false```**). Note that this can take up to 5 minutes per image. \u003Cbr\u002F>\n- Use cropped images, set the parameter ```resolution``` to:\n\n> **```high```**   &nbsp; - &nbsp; center crop of size ```1680x1260``` pixels \u003Cbr\u002F>\n> **```medium```** &nbsp; - &nbsp; center crop of size ```1366x1024``` pixels \u003Cbr\u002F>\n> **```small```** &nbsp; - &nbsp; center crop of size ```1024x768``` pixels \u003Cbr\u002F>\n> **```tiny```** &nbsp; - &nbsp; center crop of size ```800x600``` pixels \u003Cbr\u002F>\n\n&emsp;&nbsp; The less resolution is - the smaller part of the image will be processed\n\n\u003Cbr\u002F>\n\n#### 9. Citation\n\n```\n@inproceedings{ignatov2017dslr,\n  title={DSLR-Quality Photos on Mobile Devices with Deep Convolutional Networks},\n  author={Ignatov, Andrey and Kobyshev, Nikolay and Timofte, Radu and Vanhoey, Kenneth and Van Gool, Luc},\n  booktitle={Proceedings of the IEEE International Conference on Computer Vision},\n  pages={3277--3285},\n  year={2017}\n}\n```\n\n\n#### 10. Any further questions?\n\n```\nPlease contact Andrey Ignatov (andrey.ignatoff@gmail.com) for more information\n```\n","## 使用深度卷积网络在移动设备上拍摄单反相机质量的照片\n\n\u003Cbr\u002F>\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Faiff22_DPED_readme_d3bc4742075d.jpg\"\u002F>\n\n\u003Cbr\u002F>\n\n#### 1. 概述 [[论文]](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1704.02470.pdf) [[项目主页]](https:\u002F\u002Faiff22.github.io\u002F) [[增强RAW照片]](https:\u002F\u002Fgithub.com\u002Faiff22\u002FPyNET) [[渲染散景效果]](https:\u002F\u002Fgithub.com\u002Faiff22\u002FPyNET-Bokeh)\n\n提供的代码实现了这篇论文，该论文提出了一种端到端的深度学习方法，用于将普通智能手机照片转换为单反相机质量的图像。训练好的模型可以应用于任意分辨率的照片，而这种方法本身也可以推广到任何类型的数码相机。更多可视化结果可以在[这里](https:\u002F\u002Faiff22.github.io\u002F#demo)找到。\n\n\n#### 2. 前置条件\n\n- Python + Pillow、scipy、numpy、imageio 等库\n- [TensorFlow 1.x \u002F 2.x](https:\u002F\u002Fwww.tensorflow.org\u002Finstall\u002F) + [CUDA CuDNN](https:\u002F\u002Fdeveloper.nvidia.com\u002Fcudnn)\n- NVIDIA GPU\n\n\n#### 3. 初步步骤\n\n- 下载预训练的[VGG-19模型](https:\u002F\u002Fdownload.ai-benchmark.com\u002Fs\u002FCCDiWM2sE25x2dW\u002Fdownload\u002Fimagenet-vgg-verydeep-19.mat)，并将其放入`vgg_pretrained\u002F`文件夹中。\n- 下载[DPED数据集](https:\u002F\u002Faiff22.github.io\u002F#dataset)（用于CNN训练的图像块），并解压到`dped\u002F`文件夹中。\u003Csub>该文件夹应包含三个子文件夹：`sony\u002F`、`iphone\u002F`和`blackberry\u002F`。\u003C\u002Fsub>\n\n\u003Cbr\u002F>\n\n#### 4. 训练模型\n\n```bash\npython train_model.py model=\u003Cmodel>\n```\n\n必填参数：\n\n>```model```: **```iphone```**, **```blackberry```** 或 **```sony```**\n\n可选参数及其默认值：\n\n>```batch_size```: **```50```** &nbsp; - &nbsp; 批量大小 [较小的值可能导致训练不稳定] \u003Cbr\u002F>\n>```train_size```: **```30000```** &nbsp; - &nbsp; 每隔```eval_step```次迭代随机加载的训练图像块数量 \u003Cbr\u002F>\n>```eval_step```: **```1000```** &nbsp; - &nbsp; 每隔```eval_step```次迭代保存一次模型，并重新加载训练数据 \u003Cbr\u002F>\n>```num_train_iters```: **```20000```** &nbsp; - &nbsp; 训练迭代次数 \u003Cbr\u002F>\n>```learning_rate```: **```5e-4```** &nbsp; - &nbsp; 学习率 \u003Cbr\u002F>\n>```w_content```: **```10```** &nbsp; - &nbsp; 内容损失的权重 \u003Cbr\u002F>\n>```w_color```: **```0.5```** &nbsp; - &nbsp; 颜色损失的权重 \u003Cbr\u002F>\n>```w_texture```: **```1```** &nbsp; - &nbsp; 纹理[对抗性]损失的权重 \u003Cbr\u002F>\n>```w_tv```: **```2000```** &nbsp; - &nbsp; 总变差损失的权重 \u003Cbr\u002F>\n>```dped_dir```: **```dped\u002F```** &nbsp; - &nbsp; DPED数据集所在文件夹的路径 \u003Cbr\u002F>\n>```vgg_dir```: **```vgg_pretrained\u002Fimagenet-vgg-verydeep-19.mat```** &nbsp; - &nbsp; 预训练VGG-19网络的路径 \u003Cbr\u002F>\n\n示例：\n\n```bash\npython train_model.py model=iphone batch_size=50 dped_dir=dped\u002F w_color=0.7\n```\n\n\u003Cbr\u002F>\n\n#### 5. 测试提供的预训练模型\n\n```bash\npython test_model.py model=\u003Cmodel>\n```\n\n必填参数：\n\n>```model```: **```iphone_orig```**, **```blackberry_orig```** 或 **```sony_orig```**\n\n可选参数：\n\n>```test_subset```: **```full```**, **```small```** &nbsp; - &nbsp; 将处理全部29张还是仅5张测试图像 \u003Cbr\u002F>\n>```resolution```: **```orig```**, **```high```**, **```medium```**, **```small```**, **```tiny```** &nbsp; - &nbsp; 测试图像的分辨率 [**```orig```**表示原始分辨率]\u003Cbr\u002F>\n>```use_gpu```: **```true```**, **```false```** &nbsp; - &nbsp; 在GPU还是CPU上运行模型 \u003Cbr\u002F>\n>```dped_dir```: **```dped\u002F```** &nbsp; - &nbsp; DPED数据集所在文件夹的路径 \u003Cbr\u002F>\n\n示例：\n\n```bash\npython test_model.py model=iphone_orig test_subset=full resolution=orig use_gpu=true\n```\n\n\u003Cbr\u002F>\n\n#### 6. 测试获得的模型\n\n```bash\npython test_model.py model=\u003Cmodel>\n```\n\n必填参数：\n\n>```model```: **```iphone```**, **```blackberry```** 或 **```sony```**\n\n可选参数：\n\n>```test_subset```: **```full```**, **```small```** &nbsp; - &nbsp; 将处理全部29张还是仅5张测试图像 \u003Cbr\u002F>\n>```iteration```: **```all```** 或 **```\u003Cnumber>```** &nbsp; - &nbsp; 获取所有迭代的可视化结果，或仅获取特定迭代的结果，  \n>&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;**```\u003Cnumber>```** 必须是```eval_step```的倍数 \u003Cbr\u002F>\n>```resolution```: **```orig```**, **```high```**, **```medium```**, **```small```**, **```tiny```** &nbsp; - &nbsp; 测试图像的分辨率 [**```orig```**表示原始分辨率]\u003Cbr\u002F>\n>```use_gpu```: **```true```**, **```false```** &nbsp; - &nbsp; 在GPU还是CPU上运行模型 \u003Cbr\u002F>\n>```dped_dir```: **```dped\u002F```** &nbsp; - &nbsp; DPED数据集所在文件夹的路径 \u003Cbr\u002F>\n\n示例：\n\n```bash\npython test_model.py model=iphone iteration=13000 test_subset=full resolution=orig use_gpu=true\n```\n\u003Cbr\u002F>\n\n#### 7. 文件夹结构\n\n>```dped\u002F```              &nbsp; - &nbsp; 包含DPED数据集的文件夹 \u003Cbr\u002F>\n>```models\u002F```            &nbsp; - &nbsp; 训练过程中保存的日志和模型 \u003Cbr\u002F>\n>```models_orig\u002F```       &nbsp; - &nbsp; 提供的针对**```iphone```**、**```sony```**和**```blackberry```**的预训练模型 \u003Cbr\u002F>\n>```results\u002F```           &nbsp; - &nbsp; 训练时保存的小图像块的可视化结果 \u003Cbr\u002F>\n>```vgg-pretrained\u002F```    &nbsp; - &nbsp; 包含预训练VGG-19网络的文件夹 \u003Cbr\u002F>\n>```visual_results\u002F```    &nbsp; - &nbsp; 处理后[增强后的]测试图像 \u003Cbr\u002F>\n\n>```load_dataset.py```    &nbsp; - &nbsp; 加载训练数据的Python脚本 \u003Cbr\u002F>\n>```models.py```          &nbsp; - &nbsp; 图像增强[ResNet]及对抗网络的架构 \u003Cbr\u002F>\n>```ssim.py```            &nbsp; - &nbsp; SSIM评分的实现 \u003Cbr\u002F>\n>```train_model.py```     &nbsp; - &nbsp; 训练过程的实现 \u003Cbr\u002F>\n>```test_model.py```      &nbsp; - &nbsp; 将预训练模型应用于测试图像 \u003Cbr\u002F>\n>```utils.py```           &nbsp; - &nbsp; 辅助函数 \u003Cbr\u002F>\n>```vgg.py```             &nbsp; - &nbsp; 加载预训练VGG-19网络 \u003Cbr\u002F>\n\n\u003Cbr\u002F>\n\n#### 8. 问题与错误\n\n```\n如果出现“分配形状为[…]的张量时内存不足”的错误怎么办？\n```\n\n&nbsp;&nbsp; 您的GPU显存不足。如果在训练过程中发生这种情况：\n\n- 减小训练批次的大小[```batch_size```]。但请注意，较小的值可能会导致训练不稳定。\n\n&nbsp;&nbsp; 如果在测试模型时发生这种情况：\n\n- 在CPU上运行模型（将参数```use_gpu```设置为**```false```**）。请注意，这可能每张图像需要长达5分钟。 \u003Cbr\u002F>\n- 使用裁剪过的图像，将参数```resolution```设置为：\n\n> **```high```**   &nbsp; - &nbsp; 以图像中心为基准，裁剪出 ```1680x1260``` 像素的图像 \u003Cbr\u002F>\n> **```medium```** &nbsp; - &nbsp; 以图像中心为基准，裁剪出 ```1366x1024``` 像素的图像 \u003Cbr\u002F>\n> **```small```** &nbsp; - &nbsp; 以图像中心为基准，裁剪出 ```1024x768``` 像素的图像 \u003Cbr\u002F>\n> **```tiny```** &nbsp; - &nbsp; 以图像中心为基准，裁剪出 ```800x600``` 像素的图像 \u003Cbr\u002F>\n\n&emsp;&nbsp; 分辨率越低，处理的图像区域就越小。\n\n\u003Cbr\u002F>\n\n#### 9. 引用\n\n```\n@inproceedings{ignatov2017dslr,\n  title={利用深度卷积网络在移动设备上实现单反相机质量的照片},\n  author={Ignatov, Andrey 和 Kobyshev, Nikolay 和 Timofte, Radu 和 Vanhoey, Kenneth 和 Van Gool, Luc},\n  booktitle={IEEE国际计算机视觉会议论文集},\n  pages={3277--3285},\n  year={2017}\n}\n```\n\n\n#### 10. 还有其他问题吗？\n\n```\n如需更多信息，请联系 Andrey Ignatov（andrey.ignatoff@gmail.com）\n```","# DPED 快速上手指南\n\nDPED (Deep Photo Enhancer) 是一个基于深度卷积网络的开源项目，旨在将手机拍摄的普通照片转换为单反相机（DSLR）级别的高质量图像。\n\n## 环境准备\n\n在开始之前，请确保您的系统满足以下要求：\n\n*   **操作系统**: Linux \u002F macOS \u002F Windows\n*   **硬件**: NVIDIA GPU (推荐，用于加速训练和推理)\n*   **软件依赖**:\n    *   Python (建议 3.6+)\n    *   TensorFlow 1.x 或 2.x\n    *   CUDA & CuDNN (若使用 GPU)\n    *   Python 库: `Pillow`, `scipy`, `numpy`, `imageio`\n\n**安装依赖命令：**\n\n```bash\npip install pillow scipy numpy imageio tensorflow\n# 若需 GPU 支持，请根据 NVIDIA 官网指引安装对应版本的 tensorflow-gpu 及 CUDA\u002FCuDNN\n```\n\n## 安装步骤\n\n### 1. 获取代码\n克隆仓库或下载源码到本地目录。\n\n### 2. 下载预训练模型与数据集\n项目需要 VGG-19 预训练权重和 DPED 数据集才能运行。\n\n*   **下载 VGG-19 模型**:\n    下载地址：[imagenet-vgg-verydeep-19.mat](https:\u002F\u002Fdownload.ai-benchmark.com\u002Fs\u002FCCDiWM2sE25x2dW\u002Fdownload\u002Fimagenet-vgg-verydeep-19.mat)\n    存放路径：放入项目根目录下的 `vgg_pretrained\u002F` 文件夹中。\n\n*   **下载 DPED 数据集**:\n    下载地址：[DPED Dataset](https:\u002F\u002Faiff22.github.io\u002F#dataset)\n    存放路径：解压后放入项目根目录下的 `dped\u002F` 文件夹。\n    *注意：`dped\u002F` 文件夹内应包含三个子文件夹：`sony\u002F`, `iphone\u002F`, `blackberry\u002F`。*\n\n## 基本使用\n\n### 方式一：直接使用官方预训练模型（推荐新手）\n\n如果您只想快速体验效果，无需重新训练，可直接测试官方提供的模型。\n\n**命令示例（处理 iPhone 拍摄的照片）：**\n\n```bash\npython test_model.py model=iphone_orig test_subset=small resolution=orig use_gpu=true\n```\n\n**参数说明：**\n*   `model`: 选择模型类型，可选 `iphone_orig`, `blackberry_orig`, `sony_orig`。\n*   `test_subset`: 测试集大小，`small` (5 张图) 或 `full` (29 张图)。\n*   `resolution`: 图像分辨率，`orig` 表示原始分辨率。也可选 `high`, `medium`, `small`, `tiny` 以节省显存。\n*   `use_gpu`: 是否使用 GPU，设为 `true` 或 `false`。\n\n处理后的增强图片将保存在 `visual_results\u002F` 目录中。\n\n### 方式二：训练自己的模型\n\n如果您希望针对特定设备或数据分布进行微调，可以执行训练脚本。\n\n**命令示例（训练 iPhone 模型）：**\n\n```bash\npython train_model.py model=iphone batch_size=50 dped_dir=dped\u002F w_color=0.7\n```\n\n**关键参数：**\n*   `model`: 必填，指定设备类型 (`iphone`, `blackberry`, `sony`)。\n*   `batch_size`: 批次大小，默认 50。若显存不足（出现 OOM 错误），请减小此值。\n*   `num_train_iters`: 训练迭代次数，默认 20000。\n*   `eval_step`: 每多少次迭代保存一次模型并刷新数据，默认 1000。\n\n训练过程中的日志、保存的模型以及中间结果将分别存储在 `models\u002F` 和 `results\u002F` 目录中。","一位旅行博主在偏远地区仅用手机拍摄了大量素材，急需将其转化为具有单反质感的照片用于杂志专栏发布。\n\n### 没有 DPED 时\n- 手机原片在暗光环境下噪点明显，细节涂抹严重，无法达到印刷级清晰度。\n- 依赖传统修图软件手动降噪和锐化耗时极长，且容易丢失自然纹理，导致画面“塑料感”重。\n- 色彩动态范围有限，高光过曝或阴影死黑，后期拉回色彩时容易出现断层和伪影。\n- 缺乏统一的风格化处理流程，难以批量将不同场景的手机照片统一提升至专业水准。\n\n### 使用 DPED 后\n- 利用预训练的 iPhone 或 Sony 模型，一键将手机原片转换为具备单反相机景深与质感的高清图像。\n- 基于深度卷积网络的端到端处理，自动保留真实的皮肤纹理和环境细节，彻底消除人工修图的痕迹。\n- 智能扩展动态范围并校正色彩，使暗部细节丰富且高光柔和，直接满足专业出版的色彩要求。\n- 支持任意分辨率输入和批量推理，博主可在旅途中用笔记本快速处理数百张照片，极大缩短工作流。\n\nDPED 通过深度学习技术打破了硬件壁垒，让普通用户也能以极低的时间成本获得电影级的影像输出。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Faiff22_DPED_d3bc4742.jpg","aiff22","Andrey","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Faiff22_4907f9ff.jpg",null,"https:\u002F\u002Fgithub.com\u002Faiff22",[20],{"name":21,"color":22,"percentage":23},"Python","#3572A5",100,1713,369,"2026-04-10T12:34:40",4,"","必需 NVIDIA GPU。显存大小未明确说明，但文档指出若出现 OOM (内存不足) 错误需减小 batch_size 或使用 CPU；支持 CUDA (具体版本未说明，需配合安装的 TensorFlow 版本)。","未说明",{"notes":32,"python":33,"dependencies":34},"1. 必须手动下载预训练的 VGG-19 模型文件 (imagenet-vgg-verydeep-19.mat) 并放入指定文件夹。2. 必须下载 DPED 数据集 (包含 sony, iphone, blackberry 子文件夹)。3. 若在测试时显存不足，可设置 use_gpu=false 在 CPU 上运行 (每张图耗时约 5 分钟)，或通过降低分辨率参数 (high\u002Fmedium\u002Fsmall\u002Ftiny) 进行中心裁剪处理。4. 训练时 batch_size 过小可能导致训练不稳定。","未说明 (仅提及需要 Python)",[35,36,37,38,39,40],"TensorFlow 1.x 或 2.x","Pillow","scipy","numpy","imageio","CUDA CuDNN",[42,43],"开发框架","图像",[45,46,47,48,49,50,51,52],"image-enhancement","image-processing","computer-vision","deep-learning","dped","gan","convolutional-neural-networks","generative-adversarial-networks",2,"ready","2026-03-27T02:49:30.150509","2026-04-11T08:11:30.612856",[58,63,68,73,78,83],{"id":59,"question_zh":60,"answer_zh":61,"source_url":62},29240,"训练时遇到 CUDA_ERROR_OUT_OF_MEMORY（显存不足）错误怎么办？","该错误通常是因为 GPU 显存不足以运行网络。解决方法是减小 batch size（批次大小）。此外，请检查是否有其他进程占用了 GPU 显存（例如日志显示只有 9GB 可用而非完整的 11GB），关闭这些进程也能解决问题。一般来说，11-12GB 的显存足以运行该网络。如果减小 batch size 后损失值变为 NaN，可能需要进一步调整学习率或检查数据预处理。","https:\u002F\u002Fgithub.com\u002Faiff22\u002FDPED\u002Fissues\u002F14",{"id":64,"question_zh":65,"answer_zh":66,"source_url":67},29241,"生成器中为什么使用 `tanh(x) * 0.58 + 0.5` 而不是 `tanh(x) * 0.5 + 0.5` 将输出映射到 [0, 1]？","虽然 `tanh(x)` 的理论范围是 (-1, 1)，映射后应为 (0, 1)，但在实际网络训练中，要让输出严格达到 0 或 1 需要极大的输出值。使用更宽的区间（即乘以 0.58 而非 0.5，使范围约为 [-0.08, 1.08]）可以允许网络在较小的常数边界内更容易地固定两端，从而优化训练效果。","https:\u002F\u002Fgithub.com\u002Faiff22\u002FDPED\u002Fissues\u002F13",{"id":69,"question_zh":70,"answer_zh":71,"source_url":72},29242,"为什么训练和验证阶段使用图像裁剪（100*100）效果很好，但测试阶段结果很差？","这是因为测试阶段的处理方式与训练不同。在测试阶段，是将整张图像直接输入神经网络，而不是像训练那样使用裁剪块。请确保使用仓库中提供的测试代码（test_model.py），该代码包含了生成最终视觉效果所需的所有步骤，能够正确处理全图推理。","https:\u002F\u002Fgithub.com\u002Faiff22\u002FDPED\u002Fissues\u002F11",{"id":74,"question_zh":75,"answer_zh":76,"source_url":77},29243,"如何提取用于训练的数据补丁（patches）？有相关代码吗？","详细的补丁提取算法描述在论文中，主要包含两步：\n1. 使用 SIFT 特征进行粗略的图像对齐（可参考 VLFeat 库）。\n2. 在预对齐的图像对上，使用滑动窗口方法精确提取对齐的补丁。两个滑动窗口沿 DSLR 和手机图像对平行移动，其中一个窗口的位置会通过微小的平移和旋转进行调整，以最大化观察到的补丁之间的互信息（cross-entropy）。如果互信息大于阈值（0.9），则将当前的两个补丁加入训练数据集。官方未直接提供此预处理代码，需参考论文逻辑自行实现。","https:\u002F\u002Fgithub.com\u002Faiff22\u002FDPED\u002Fissues\u002F7",{"id":79,"question_zh":80,"answer_zh":81,"source_url":82},29244,"在 TensorFlow 2.x 环境下运行报错 `AttributeError: 'NoneType' object has no attribute 'value'` 如何解决？","这是因为代码原本是为 TensorFlow 1.x 编写的。如果在 TensorFlow 2+ 环境中运行，需要在导入 tensorflow 库后立即添加以下代码以禁用 v2 行为，从而保持兼容性：\n```python\nimport tensorflow as tf\ntf.compat.v1.disable_v2_behavior()\n```","https:\u002F\u002Fgithub.com\u002Faiff22\u002FDPED\u002Fissues\u002F26",{"id":84,"question_zh":85,"answer_zh":86,"source_url":87},29245,"PSNR 和 MS-SSIM 分数是如何计算的？测试集是否包含所有相机型号的对齐数据？","1. PSNR 和 MS-SSIM 分数是在图像补丁（patches）上计算的，而不是在全分辨率图像上计算的。\n2. 公开的数据集中可能不包含所有相机型号（如 Canon）的全尺寸对齐数据，部分测试使用了私有数据进行模型评估。如果需要使用特定相机的全尺寸对齐数据进行训练或测试，可能需要参考论文中的对齐方法自行处理数据。","https:\u002F\u002Fgithub.com\u002Faiff22\u002FDPED\u002Fissues\u002F21",[],[90,101,109,118,126,135],{"id":91,"name":92,"github_repo":93,"description_zh":94,"stars":95,"difficulty_score":96,"last_commit_at":97,"category_tags":98,"status":54},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[99,42,43,100],"Agent","数据工具",{"id":102,"name":103,"github_repo":104,"description_zh":105,"stars":106,"difficulty_score":96,"last_commit_at":107,"category_tags":108,"status":54},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[42,43,99],{"id":110,"name":111,"github_repo":112,"description_zh":113,"stars":114,"difficulty_score":53,"last_commit_at":115,"category_tags":116,"status":54},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",150037,"2026-04-10T23:33:47",[42,99,117],"语言模型",{"id":119,"name":120,"github_repo":121,"description_zh":122,"stars":123,"difficulty_score":53,"last_commit_at":124,"category_tags":125,"status":54},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[42,43,99],{"id":127,"name":128,"github_repo":129,"description_zh":130,"stars":131,"difficulty_score":53,"last_commit_at":132,"category_tags":133,"status":54},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[134,99,43,42],"插件",{"id":136,"name":137,"github_repo":138,"description_zh":139,"stars":140,"difficulty_score":53,"last_commit_at":141,"category_tags":142,"status":54},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[134,42]]