[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-OndrejTexler--Few-Shot-Patch-Based-Training":3,"tool-OndrejTexler--Few-Shot-Patch-Based-Training":64},[4,17,27,35,43,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},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,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},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 真正成长为懂上",138956,2,"2026-04-05T11:33:21",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,26],{"id":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":80,"owner_email":81,"owner_twitter":82,"owner_website":83,"owner_url":84,"languages":85,"stars":105,"forks":106,"last_commit_at":107,"license":82,"difficulty_score":10,"env_os":108,"env_gpu":109,"env_ram":110,"env_deps":111,"category_tags":124,"github_topics":125,"view_count":10,"oss_zip_url":82,"oss_zip_packed_at":82,"status":16,"created_at":133,"updated_at":134,"faqs":135,"releases":174},874,"OndrejTexler\u002FFew-Shot-Patch-Based-Training","Few-Shot-Patch-Based-Training","The official implementation of our SIGGRAPH 2020 paper Interactive Video Stylization Using Few-Shot Patch-Based Training","Few-Shot-Patch-Based-Training 是一个基于少量示例进行视频风格化的开源工具。它通过让用户提供少量（例如5-10张）风格参考图片，即可训练出一个能够将视频转换为相应艺术风格的模型。其核心方法是“基于分块的训练”，能够高效学习并应用风格，实现实时或近实时的视频艺术化处理。\n\n该工具主要解决了传统视频风格化中需要大量数据、训练时间长以及风格迁移效果不稳定等问题。通过创新的分块采样和训练机制，它能在几分钟内完成模型训练，并生成视觉效果连贯、风格鲜明的结果，同时支持交互式调整。\n\n它非常适合计算机视觉和图形学领域的研究人员、数字媒体艺术家以及相关技术的开发者使用。研究人员可以借此探索小样本学习与风格迁移的结合；艺术家和设计师能快速为视频项目尝试不同的艺术风格；开发者则可将其集成到更广泛的视频处理或创意工具链中。\n\n技术上的亮点在于其“基于分块的训练”策略。这种方法不是直接处理整张图像，而是从风格图像和视频帧中提取大量小块进行匹配和学习，从而更高效地捕捉纹理和模式，并显著减少了训练所需的数据量和时间。工具还提供了预训练模型和详细的代码，方便用户快速上手和实验。","# Interactive Video Stylization Using Few-Shot Patch-Based Training\n\nThe official implementation of\n\n> **Interactive Video Stylization Using Few-Shot Patch-Based Training** \u003C\u002Fbr>\n_[O. Texler](https:\u002F\u002Fondrejtexler.github.io\u002F), [D. Futschik](https:\u002F\u002Fdcgi.fel.cvut.cz\u002Fpeople\u002Ffutscdav),\n[M. Kučera](https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fkuceram\u002F), [O. Jamriška](https:\u002F\u002Fdcgi.fel.cvut.cz\u002Fpeople\u002Fjamriond), \n[Š. Sochorová](https:\u002F\u002Fdcgi.fel.cvut.cz\u002Fpeople\u002Fsochosar), [M. Chai](http:\u002F\u002Fwww.mlchai.com), \n[S. Tulyakov](http:\u002F\u002Fwww.stulyakov.com), and [D. Sýkora](https:\u002F\u002Fdcgi.fel.cvut.cz\u002Fhome\u002Fsykorad\u002F)_ \u003C\u002Fbr>\n[[`WebPage`](https:\u002F\u002Fondrejtexler.github.io\u002Fpatch-based_training)],\n[[`Paper`](https:\u002F\u002Fondrejtexler.github.io\u002Fres\u002FTexler20-SIG_patch-based_training_main.pdf)],\n[[`BiBTeX`](#CitingFewShotPatchBasedTraining)]\n\n![Teaser](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FOndrejTexler_Few-Shot-Patch-Based-Training_readme_5d0aa61789d6.gif)\n\n\n## Run\n\nDownload the \n[testing-data.zip](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1EscSNFg4ILpB7dxr-zYw_UdOILLmDlRj\u002Fview?usp=sharing), \nand unzip. The _train folder is expected to be next to the _gen folder.\n\n### Pre-Trained Models\nIf you want just quickly test the network, here are some \n[pre-trained-models.zip](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F11_lCPqKDAtkMQTCSNTKBu2Sii8km_04s\u002Fview?usp=sharing).\nUnzip, and follow with the Generate step. Be sure to set the correct --checkpoint path \nwhen calling `generate.py`, e.g., `_pre-trained-models\u002FZuzka2\u002Fmodel_00020.pth`.\n\n\n### Train\nTo train the network, run the `train.py` \nSee the example command below:\n\n```\ntrain.py --config \"_config\u002Freference_P.yaml\" \n\t\t --data_root \"Zuzka2_train\" \n\t\t --log_interval 1000 \n\t\t --log_folder logs_reference_P\n```\n\nEvery 1000 (log_interval) epochs, `train.py` saves the current generator to \nlogs_reference_P (log_folder), and it validates\u002Fruns the generator on _gen data - the \nresult is saved in Zuzka2_gen\u002Fres__P\n\n\n### Generate\nTo generate the results, run `generate.py`. \n\n```\ngenerate.py --checkpoint \"Zuzka2_train\u002Flogs_reference_P\u002Fmodel_00020.pth\" \n\t    --data_root \"Zuzka2_gen\"\n\t    --dir_input \"input_filtered\"\n\t    --outdir \"Zuzka2_gen\u002Fres_00020\" \n\t    --device \"cuda:0\"\n```\n\nTo generate the results on live webcam footage, run `generate_webcam.py`. To stop the generation, press q while the preview window is active.\n\n```\ngenerate_webcam.py --checkpoint \"Zuzka2_train\u002Flogs_reference_P\u002Fmodel_00020.pth\" \n\t    --device \"cuda:0\"\n\t    --resolution 1280 720\n\t    --show_original 1\n\t    --resize 256\n```\nAn optional resolution argument has been added, but the images will be always cropped to square, and resized to the size of resize x resize for shorter delay.\n\n\n## Installation\nTested on Windows 10, `Python 3.7.8`, `CUDA 10.2`.\nWith the following python packages:\n```\nnumpy                  1.19.1\nopencv-python          4.4.0.40\nPillow                 7.2.0\nPyYAML                 5.3.1\nscikit-image           0.17.2\nscipy                  1.5.2\ntensorflow \t       1.15.3 (tensorflow is used only in the logger.py, I will remove this not-necessary dependency soon)\ntorch                  1.6.0\ntorchvision            0.7.0\n```\n\n## Temporal Consistency [Optional]\nThis section is optional. It describes steps that can help to maintain temporal \ncoherency of the resulting video sequence. All example commands and build scripts in this section \nassume Windows; however, it should be really straightforward to\nbuild it and run it on Linux\u002FMacOS.\n\nAs the temporal consistency in our technique is not explicitly enforced, it gives us many advantages, \ne.g., parallel processing, fast training, etc., but the resulting stylized sequence may contain disturbing \namount of flickering. While temporal consistency can be caused by various factors, below, we discuss how\nto deal with two most crucial of them.\n\n\n### Noise in the Input Sequence\nThe input video sequence captured by a camera usually contains some amount of temporal noise. \nWhile this noise might not be visible by the naked eye or might seem negligible, the network \ntends to amplify it. To deal with this issue, we propose to filter the input sequence using \ntime-aware bilateral filter.\n\nFirst, optical flow has to be computed. Use the optical flow tool in `_tools\u002Fdisflow`. \nSee section **Build disflow** below on how to build the tool.\nOnce `disflow.exe` is built and present in the PATH, see and modify the first few lines of \n`_tools\u002Ftool_disflow.py`, and run it. It reads PNGs from the `input` folder and stores optical flow in \n`flow_fwd` and `flow_bwd` folder.\n\nOnce, the optical flow is computed, use time-aware bilateral filter tool `_tools\u002FbilateralAdv` to\nfilter the sequence. See section **Build bilateralAdv** below on how to build the tool.\nOnce `bilateralAdv.exe` is built and present in the PATH, see and modify the first few lines of \n`_tools\u002Ftool_bilateralAdv.py`, and run it. It reads PNGs from the `input` folder, and optical flow data \nfrom the `flow_fwd` and `flow_bwd`; it stores filtered sequence in `input_filtered`. \nNote, feel free to parallelize the for loop in `_tools\u002Ftool_bilateralAdv.py`, `bilateralAdv.exe` \nuses optical flow and can be run frame by frame independently. Also, feel free to optimize \n`bilateralAdv.exe` so that is uses multiple CPU-cores or even a GPU ... I am thrilled to see \nyour pull request :-)\n\nFinally, to do the training and inference, use filtered `input_sequence` images instead \nof the original noisy `input` images. Hopefully, the results will be more stable in time.\n\n\n### Ambiguity in the Training Data\nAs the network is trained on small, by default 32x32 px patches, it is likely that multiple 32x32 px \npatches from `input` RGB frame will be very similar. For instance, if there is sky in the background of input \nimage, patches from left and right part of the sky will likely be very similar. The problem is that in the\nstylyzed exemplar, these patches might be stylized slightly differently. And that is the ambiguity, \nmultiple similar input patches will be, during the training, mapped to different stylized patches. \nTo deal with this, we propose to use an auxiliary RGB input images that will make all input\npatches unique.\n\nFirst, optical flow has to be computed. Use the optical flow tool in `_tools\u002Fdisflow`. \nSee section **Build disflow** below on how to build the tool.\nOnce `disflow.exe` is built and present in the PATH, see and modify the first few lines of \n`_tools\u002Ftool_disflow.py`, and run it. It reads PNGs from the `input` folder and stores optical flow in \n`flow_fwd` and `flow_bwd` folder.\n\nOnce, the optical flow is computed, use `_tools\u002Fgauss` to compute auxiliary gaussian mixture images.\nSee section **Build gauss** below on how to build the tool.\nOnce `gauss.exe` is built and present in the PATH, see and modify the first few lines of \n`_tools\u002Ftool_gauss.py`, and run it. It reads mask images from the `mask` folder \n(these masks can but do not need to match the masks you use during training, \nsee the section below for more info), and optical flow data \nfrom the `flow_fwd` and `flow_bwd`; it outputs two different gaussian mixtures in \n`input_gdisko_gauss_r10_s10` (smaller circles) and `input_gdisko_gauss_r10_s15` (larger circles).\nPick one of them, e.g., `input_gdisko_gauss_r10_s10`, if it does not work well, try the other one.\nPlace the folder `input_gdisko_gauss_r10_s10` next to your `input` folder in both _gen as \nwell as _train folder, in _train folder, the `input_gdisko_gauss_r10_s10` will contain only\nframes corresponding ot the stylized keyframes, e.g., 001.png for Maruska640 sequence or \n000.png, 030.png, 070.png, and 103.png for Zuzka2 sequence. To train, do not forget to use\nthe correct config file, e.g., `--config \"_config\u002Freference_P_disco1010.yaml\"` while running \n`train.py` script. To run the inference `generate.py` script, use an optional \nargument `--dir_x1 input_gdisko_gauss_r10_s10` that will tell the `generate.py` \nto load images from `input_gdisko_gauss_r10_s10`.\n\n#### Masks for Gauss\nWhile running the `gauss.exe`, the gaussian mixtures are generated for every mask image,\nand are propagated to the sequence using optical flow, if there are multiple mask images \nprovided, the resulting gaussian circles will be stacked on top of each other (and they will cover\npotential holes). The mask can (and in most cases will) be fully-white \nimages. If you are not sure what frames to pick as mask, pick the same as your keyframes \nor\u002Fand first and last frame of the sequence. See the gaussian mixture results, e.g., \n`input_gdisko_gauss_r10_s10`, if there are large black holes (larger than 100x100 px),\nadd one more mask image for the frame where the black holes are the largest.\n\n\n### Build Temporal Consistency Tools\n\n#### Build disflow\nOn Windows, try to use prebuilt `disflow.exe`. Otherwise, use `_tools\u002Fdisflow\u002Fbuild_win.bat` \nto build `disflow.exe` yourself (on Linux\u002FMacOS, get inspired by \nthe build script, it should be really easy to build it). As it links against OpenCV-4.2.0,\nit expects the `opencv_world420.dll` in PATH. Download [OpenCV-4.2.0](https:\u002F\u002Fopencv.org\u002Fopencv-4-2-0\u002F),\nthey offer prebuilt \n[Win pack](https:\u002F\u002Fsourceforge.net\u002Fprojects\u002Fopencvlibrary\u002Ffiles\u002F4.2.0\u002Fopencv-4.2.0-vc14_vc15.exe\u002Fdownload). \nFeel free to modify the build script to use a different version of OpenCV. Note, OpenCV includes are \nprovided and located at `_tools\\disflow\\opencv-4.2.0\\include`, Windows .lib files are provided and \nlocated at `_tools\\disflow\\opencv-4.2.0\\lib`.\n\n#### Build bilateralAdv\nOn Windows, try to use prebuilt `bilateralAdv.exe`. Otherwise, use `_tools\u002FbilateralAdv\u002Fbuild_win.bat` \nto build `bilateralAdv.exe` yourself (on Linux\u002FMacOS, get inspired by \nthe build script, it should be really easy to build it).\n\n#### Build gauss\nOn Windows, try to use prebuilt `gauss.exe`. Otherwise, use `_tools\u002Fgauss\u002Fbuild_win.bat` \nto build `gauss.exe` yourself (on Linux\u002FMacOS, get inspired by \nthe build script, it should be really easy to build it).\n\n\n## Other Implementations \n* Thank you, [Midas](https:\u002F\u002Fgithub.com\u002Frnwzd), for reimplementing this repo in PyTorch Lightning, see https:\u002F\u002Fgithub.com\u002Frnwzd\u002FFSPBT-Image-Translation\n\n\n## Credits\n* This project started when [Ondrej Texler](https:\u002F\u002Fondrejtexler.github.io\u002F) was an \n  intern at [Snap Inc.](https:\u002F\u002Fwww.snap.com\u002F), and it was funded \n  by [Snap Inc.](https:\u002F\u002Fwww.snap.com\u002F) \n  and [Czech Technical University in Prague](https:\u002F\u002Fwww.cvut.cz\u002Fen)\n* The main engineering forces behind this repository \n  are [Ondrej Texler](https:\u002F\u002Fondrejtexler.github.io\u002F), \n  [David Futschik](https:\u002F\u002Fdcgi.fel.cvut.cz\u002Fpeople\u002Ffutscdav), and \n  [Michal Kučera](https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fkuceram\u002F).\n* The main engineering forces behind temporal consistency tools \n  are [Ondrej Jamriska](https:\u002F\u002Fdcgi.fel.cvut.cz\u002Fpeople\u002Fjamriond) \n  and [Sarka Sochorova](https:\u002F\u002Fdcgi.fel.cvut.cz\u002Fpeople\u002Fsochosar)\n\n\n## License\n* The Patch-Based Training method is not patented, and we do not plan on patenting. \n* However, you should be aware that certain parts of the code in this repository \n  were written when [Ondrej Texler](https:\u002F\u002Fondrejtexler.github.io\u002F) \n  and [David Futschik](https:\u002F\u002Fdcgi.fel.cvut.cz\u002Fpeople\u002Ffutscdav) were employed \n  by [Snap Inc.](https:\u002F\u002Fwww.snap.com\u002F). If you find this project useful for your \n  commercial interests, please, reimplement it.\n\n\n## \u003Ca name=\"CitingFewShotPatchBasedTraining\">\u003C\u002Fa>Citing\nIf you find Interactive Video Stylization Using Few-Shot Patch-Based Training useful \nfor your research or work, please use the following BibTeX entry.\n\n```\n@Article{Texler20-SIG,\n    author    = \"Ond\\v{r}ej Texler and David Futschik and Michal Ku\\v{c}era and Ond\\v{r}ej Jamri\\v{s}ka and \\v{S}\\'{a}rka Sochorov\\'{a} and Menglei Chai and Sergey Tulyakov and Daniel S\\'{y}kora\",\n    title     = \"Interactive Video Stylization Using Few-Shot Patch-Based Training\",\n    journal   = \"ACM Transactions on Graphics\",\n    volume    = \"39\",\n    number    = \"4\",\n    pages     = \"73\",\n    year      = \"2020\",\n}\n```\n\n","# 基于少量样本块训练的视频交互式风格化\n\n官方实现\n\n> **基于少量样本块训练的视频交互式风格化** \u003C\u002Fbr>\n_[O. Texler](https:\u002F\u002Fondrejtexler.github.io\u002F), [D. Futschik](https:\u002F\u002Fdcgi.fel.cvut.cz\u002Fpeople\u002Ffutscdav),\n[M. Kučera](https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fkuceram\u002F), [O. Jamriška](https:\u002F\u002Fdcgi.fel.cvut.cz\u002Fpeople\u002Fjamriond), \n[Š. Sochorová](https:\u002F\u002Fdcgi.fel.cvut.cz\u002Fpeople\u002Fsochosar), [M. Chai](http:\u002F\u002Fwww.mlchai.com), \n[S. Tulyakov](http:\u002F\u002Fwww.stulyakov.com), and [D. Sýkora](https:\u002F\u002Fdcgi.fel.cvut.cz\u002Fhome\u002Fsykorad\u002F)_ \u003C\u002Fbr>\n[[`项目主页`](https:\u002F\u002Fondrejtexler.github.io\u002Fpatch-based_training)],\n[[`论文`](https:\u002F\u002Fondrejtexler.github.io\u002Fres\u002FTexler20-SIG_patch-based_training_main.pdf)],\n[[`BiBTeX`](#引用基于少量样本块训练)]\n\n![效果演示](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FOndrejTexler_Few-Shot-Patch-Based-Training_readme_5d0aa61789d6.gif)\n\n\n## 运行\n\n下载 [testing-data.zip](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1EscSNFg4ILpB7dxr-zYw_UdOILLmDlRj\u002Fview?usp=sharing) 并解压。请确保 `_train` 文件夹与 `_gen` 文件夹位于同级目录。\n\n### 预训练模型\n如果你想快速测试网络，这里提供一些 [预训练模型](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F11_lCPqKDAtkMQTCSNTKBu2Sii8km_04s\u002Fview?usp=sharing)。解压后，按照生成步骤操作。调用 `generate.py` 时，请确保设置正确的 `--checkpoint` 路径，例如 `_pre-trained-models\u002FZuzka2\u002Fmodel_00020.pth`。\n\n### 训练\n要训练网络，请运行 `train.py`。参考以下示例命令：\n\n```\ntrain.py --config \"_config\u002Freference_P.yaml\" \n\t\t --data_root \"Zuzka2_train\" \n\t\t --log_interval 1000 \n\t\t --log_folder logs_reference_P\n```\n\n每 1000 个周期（log_interval），`train.py` 会将当前的生成器保存到 `logs_reference_P`（log_folder）目录中，并在 `_gen` 数据上验证\u002F运行生成器，结果将保存在 `Zuzka2_gen\u002Fres__P` 目录中。\n\n### 生成\n要生成结果，请运行 `generate.py`。\n\n```\ngenerate.py --checkpoint \"Zuzka2_train\u002Flogs_reference_P\u002Fmodel_00020.pth\" \n\t    --data_root \"Zuzka2_gen\"\n\t    --dir_input \"input_filtered\"\n\t    --outdir \"Zuzka2_gen\u002Fres_00020\" \n\t    --device \"cuda:0\"\n```\n\n要在实时网络摄像头画面上生成结果，请运行 `generate_webcam.py`。要停止生成，请在预览窗口激活时按下 `q` 键。\n\n```\ngenerate_webcam.py --checkpoint \"Zuzka2_train\u002Flogs_reference_P\u002Fmodel_00020.pth\" \n\t    --device \"cuda:0\"\n\t    --resolution 1280 720\n\t    --show_original 1\n\t    --resize 256\n```\n添加了可选的 `resolution` 参数，但图像始终会被裁剪为正方形，并调整大小为 `resize x resize` 以减少延迟。\n\n## 安装\n已在 Windows 10、`Python 3.7.8`、`CUDA 10.2` 环境下测试通过。\n需要以下 Python 包：\n```\nnumpy                  1.19.1\nopencv-python          4.4.0.40\nPillow                 7.2.0\nPyYAML                 5.3.1\nscikit-image           0.17.2\nscipy                  1.5.2\ntensorflow \t       1.15.3 (tensorflow 仅在 logger.py 中使用，我将很快移除这个非必要的依赖)\ntorch                  1.6.0\ntorchvision            0.7.0\n```\n\n## 时间一致性 [可选]\n本节为可选内容。它描述了有助于保持结果视频序列时间连贯性的步骤。本节中的所有示例命令和构建脚本均假设在 Windows 环境下运行；然而，在 Linux\u002FMacOS 上构建和运行应该非常简单直接。\n\n由于我们的技术没有显式地强制时间一致性，这带来了许多优势，例如并行处理、快速训练等，但风格化后的结果序列可能包含令人不适的闪烁。虽然时间不一致可能由多种因素引起，但下面我们将讨论如何处理其中最关键的两个因素。\n\n### 输入序列中的噪声\n相机捕捉到的输入视频序列通常包含一定量的时间噪声。虽然这种噪声可能肉眼不可见或看似微不足道，但网络往往会将其放大。为了解决这个问题，我们建议使用时域双边滤波器对输入序列进行滤波。\n\n首先，需要计算光流。使用 `_tools\u002Fdisflow` 中的光流工具。请参阅下面的 **构建 disflow** 部分了解如何构建该工具。\n一旦 `disflow.exe` 构建完成并位于 PATH 环境变量中，查看并修改 `_tools\u002Ftool_disflow.py` 的前几行，然后运行它。它会从 `input` 文件夹读取 PNG 图像，并将光流数据存储在 `flow_fwd` 和 `flow_bwd` 文件夹中。\n\n计算完光流后，使用时域双边滤波器工具 `_tools\u002FbilateralAdv` 对序列进行滤波。请参阅下面的 **构建 bilateralAdv** 部分了解如何构建该工具。\n一旦 `bilateralAdv.exe` 构建完成并位于 PATH 环境变量中，查看并修改 `_tools\u002Ftool_bilateralAdv.py` 的前几行，然后运行它。它会从 `input` 文件夹读取 PNG 图像，并从 `flow_fwd` 和 `flow_bwd` 读取光流数据；它将滤波后的序列存储在 `input_filtered` 文件夹中。\n注意，可以随意并行化 `_tools\u002Ftool_bilateralAdv.py` 中的 for 循环，`bilateralAdv.exe` 使用光流并且可以逐帧独立运行。同时，也欢迎优化 `bilateralAdv.exe` 以使其使用多 CPU 核心甚至 GPU……我非常期待看到你的拉取请求 :-)\n\n最后，进行训练和推理时，请使用滤波后的 `input_filtered` 图像，而不是原始的含噪声的 `input` 图像。希望结果在时间上会更加稳定。\n\n### 训练数据中的歧义性\n由于网络是在较小的（默认为32x32像素）图像块上进行训练的，来自`input` RGB帧的多个32x32像素块很可能非常相似。例如，如果输入图像的背景中有天空，那么来自天空左右部分的图像块很可能非常相似。问题在于，在风格化的示例中，这些图像块可能会被风格化得略有不同。这就是歧义性所在：在训练过程中，多个相似的输入图像块会被映射到不同的风格化图像块。为了解决这个问题，我们建议使用辅助的RGB输入图像，使所有输入图像块都具有独特性。\n\n首先，需要计算光流。使用`_tools\u002Fdisflow`中的光流工具。关于如何构建该工具，请参见下面的**构建disflow**部分。一旦`disflow.exe`构建完成并存在于PATH中，请查看并修改`_tools\u002Ftool_disflow.py`的前几行，然后运行它。它会从`input`文件夹读取PNG图像，并将光流数据存储在`flow_fwd`和`flow_bwd`文件夹中。\n\n光流计算完成后，使用`_tools\u002Fgauss`来计算辅助的高斯混合图像。关于如何构建该工具，请参见下面的**构建gauss**部分。一旦`gauss.exe`构建完成并存在于PATH中，请查看并修改`_tools\u002Ftool_gauss.py`的前几行，然后运行它。它会从`mask`文件夹读取掩码图像（这些掩码可以与训练时使用的掩码匹配，但不是必须的，更多信息请参见下面的部分），并从`flow_fwd`和`flow_bwd`读取光流数据；然后输出两种不同的高斯混合图像到`input_gdisko_gauss_r10_s10`（较小的圆圈）和`input_gdisko_gauss_r10_s15`（较大的圆圈）。选择其中一个，例如`input_gdisko_gauss_r10_s10`，如果效果不佳，可以尝试另一个。将`input_gdisko_gauss_r10_s10`文件夹放置在`input`文件夹旁边，在_gen和_train文件夹中都放置一份。在_train文件夹中，`input_gdisko_gauss_r10_s10`将仅包含与风格化关键帧对应的帧，例如Maruska640序列的001.png，或Zuzka2序列的000.png、030.png、070.png和103.png。训练时，不要忘记在运行`train.py`脚本时使用正确的配置文件，例如`--config \"_config\u002Freference_P_disco1010.yaml\"`。运行推理脚本`generate.py`时，使用可选参数`--dir_x1 input_gdisko_gauss_r10_s10`，这会告诉`generate.py`从`input_gdisko_gauss_r10_s10`加载图像。\n\n#### 高斯混合的掩码\n运行`gauss.exe`时，会为每个掩码图像生成高斯混合，并通过光流传播到整个序列。如果提供了多个掩码图像，生成的高斯圆圈会叠加在一起（并覆盖潜在的空白区域）。掩码可以是（并且在大多数情况下应该是）全白的图像。如果不确定选择哪些帧作为掩码，可以选择与关键帧相同的帧，或者序列的第一帧和最后一帧。查看高斯混合的结果，例如`input_gdisko_gauss_r10_s10`，如果存在较大的黑色区域（大于100x100像素），请在黑色区域最大的帧上添加一个额外的掩码图像。\n\n### 构建时间一致性工具\n\n#### 构建disflow\n在Windows上，尝试使用预构建的`disflow.exe`。否则，使用`_tools\u002Fdisflow\u002Fbuild_win.bat`自行构建`disflow.exe`（在Linux\u002FMacOS上，可以参考构建脚本，构建过程应该非常简单）。由于它链接到OpenCV-4.2.0，因此需要在PATH中包含`opencv_world420.dll`。下载[OpenCV-4.2.0](https:\u002F\u002Fopencv.org\u002Fopencv-4-2-0\u002F)，他们提供了预构建的[Win包](https:\u002F\u002Fsourceforge.net\u002Fprojects\u002Fopencvlibrary\u002Ffiles\u002F4.2.0\u002Fopencv-4.2.0-vc14_vc15.exe\u002Fdownload)。可以自由修改构建脚本以使用不同版本的OpenCV。注意，OpenCV头文件已提供，位于`_tools\\disflow\\opencv-4.2.0\\include`，Windows的.lib文件已提供，位于`_tools\\disflow\\opencv-4.2.0\\lib`。\n\n#### 构建bilateralAdv\n在Windows上，尝试使用预构建的`bilateralAdv.exe`。否则，使用`_tools\u002FbilateralAdv\u002Fbuild_win.bat`自行构建`bilateralAdv.exe`（在Linux\u002FMacOS上，可以参考构建脚本，构建过程应该非常简单）。\n\n#### 构建gauss\n在Windows上，尝试使用预构建的`gauss.exe`。否则，使用`_tools\u002Fgauss\u002Fbuild_win.bat`自行构建`gauss.exe`（在Linux\u002FMacOS上，可以参考构建脚本，构建过程应该非常简单）。\n\n## 其他实现\n* 感谢[Midas](https:\u002F\u002Fgithub.com\u002Frnwzd)在PyTorch Lightning中重新实现了这个仓库，参见https:\u002F\u002Fgithub.com\u002Frnwzd\u002FFSPBT-Image-Translation。\n\n## 致谢\n* 这个项目始于[Ondrej Texler](https:\u002F\u002Fondrejtexler.github.io\u002F)在[Snap Inc.](https:\u002F\u002Fwww.snap.com\u002F)实习期间，由[Snap Inc.](https:\u002F\u002Fwww.snap.com\u002F)和[捷克技术大学布拉格分校](https:\u002F\u002Fwww.cvut.cz\u002Fen)资助。\n* 这个仓库的主要工程贡献者是[Ondrej Texler](https:\u002F\u002Fondrejtexler.github.io\u002F)、[David Futschik](https:\u002F\u002Fdcgi.fel.cvut.cz\u002Fpeople\u002Ffutscdav)和[Michal Kučera](https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fkuceram\u002F)。\n* 时间一致性工具的主要工程贡献者是[Ondrej Jamriska](https:\u002F\u002Fdcgi.fel.cvut.cz\u002Fpeople\u002Fjamriond)和[Sarka Sochorova](https:\u002F\u002Fdcgi.fel.cvut.cz\u002Fpeople\u002Fsochosar)。\n\n## 许可证\n* 基于图像块的训练方法未申请专利，我们也没有计划申请专利。\n* 但是，请注意，这个仓库中的部分代码是[Ondrej Texler](https:\u002F\u002Fondrejtexler.github.io\u002F)和[David Futschik](https:\u002F\u002Fdcgi.fel.cvut.cz\u002Fpeople\u002Ffutscdav)在[Snap Inc.](https:\u002F\u002Fwww.snap.com\u002F)任职期间编写的。如果您发现这个项目对您的商业利益有用，请重新实现它。\n\n## \u003Ca name=\"CitingFewShotPatchBasedTraining\">\u003C\u002Fa>引用\n如果您发现“基于图像块的少样本训练交互式视频风格化”对您的研究或工作有用，请使用以下BibTeX条目。\n\n```\n@Article{Texler20-SIG,\n    author    = \"Ond\\v{r}ej Texler and David Futschik and Michal Ku\\v{c}era and Ond\\v{r}ej Jamri\\v{s}ka and \\v{S}\\'{a}rka Sochorov\\'{a} and Menglei Chai and Sergey Tulyakov and Daniel S\\'{y}kora\",\n    title     = \"Interactive Video Stylization Using Few-Shot Patch-Based Training\",\n    journal   = \"ACM Transactions on Graphics\",\n    volume    = \"39\",\n    number    = \"4\",\n    pages     = \"73\",\n    year      = \"2020\",\n}\n```","# Few-Shot-Patch-Based-Training 快速上手指南\n\nFew-Shot-Patch-Based-Training 是一个用于“基于少量样本和图像块训练的交互式视频风格化”项目的官方实现。本指南将帮助您快速配置环境并运行基础功能。\n\n## 环境准备\n\n### 系统要求\n*   **操作系统**: 已在 Windows 10 上测试通过。理论上也支持 Linux\u002FMacOS。\n*   **Python**: 3.7.8\n*   **CUDA**: 10.2 (如需 GPU 加速)\n\n### 前置依赖\n需要安装以下 Python 包及其指定版本：\n```\nnumpy                  1.19.1\nopencv-python          4.4.0.40\nPillow                 7.2.0\nPyYAML                 5.3.1\nscikit-image           0.17.2\nscipy                  1.5.2\ntensorflow             1.15.3  # 仅用于 logger.py，未来将移除\ntorch                  1.6.0\ntorchvision            0.7.0\n```\n\n## 安装步骤\n\n1.  **克隆或下载项目代码**。\n2.  **创建并激活 Python 虚拟环境**（推荐）。\n3.  **使用 pip 安装依赖包**。建议使用国内镜像源（如清华源）加速下载：\n    ```bash\n    pip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n    ```\n    如果项目未提供 `requirements.txt` 文件，请手动安装上述列出的包及对应版本。\n\n## 基本使用\n\n### 1. 下载数据与预训练模型\n*   **测试数据**：下载 [testing-data.zip](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F1EscSNFg4ILpB7dxr-zYw_UdOILLmDlRj\u002Fview?usp=sharing) 并解压。确保 `_train` 文件夹与 `_gen` 文件夹位于同级目录。\n*   **预训练模型（可选）**：如需快速测试，可下载 [pre-trained-models.zip](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F11_lCPqKDAtkMQTCSNTKBu2Sii8km_04s\u002Fview?usp=sharing) 并解压。\n\n### 2. 训练模型\n运行 `train.py` 脚本。以下是一个示例命令：\n```bash\ntrain.py --config \"_config\u002Freference_P.yaml\" \n         --data_root \"Zuzka2_train\" \n         --log_interval 1000 \n         --log_folder logs_reference_P\n```\n此命令会每隔1000轮（`log_interval`）将当前生成器模型保存到 `logs_reference_P` 文件夹，并在 `_gen` 数据上进行验证，结果保存在 `Zuzka2_gen\u002Fres__P`。\n\n### 3. 生成风格化结果\n运行 `generate.py` 脚本。使用上一步训练得到的检查点文件。\n```bash\ngenerate.py --checkpoint \"Zuzka2_train\u002Flogs_reference_P\u002Fmodel_00020.pth\" \n            --data_root \"Zuzka2_gen\"\n            --dir_input \"input_filtered\"\n            --outdir \"Zuzka2_gen\u002Fres_00020\" \n            --device \"cuda:0\"\n```\n\n### 4. 实时摄像头风格化（可选）\n运行 `generate_webcam.py` 脚本，可将风格化效果实时应用于摄像头画面。按 `q` 键可退出。\n```bash\ngenerate_webcam.py --checkpoint \"Zuzka2_train\u002Flogs_reference_P\u002Fmodel_00020.pth\" \n                   --device \"cuda:0\"\n                   --resolution 1280 720\n                   --show_original 1\n                   --resize 256\n```","**场景背景**：一家小型创意工作室需要为客户的品牌宣传视频快速制作统一的艺术风格滤镜，他们手头只有客户提供的30秒产品特写视频和5张参考风格图片（如水彩画、版画效果）。\n\n### 没有 Few-Shot-Patch-Based-Training 时\n- **风格迁移质量不稳定**：使用传统的神经风格迁移方法，需要对整个视频逐帧处理，结果帧与帧之间的风格应用不一致，导致最终视频闪烁、抖动严重，视觉效果很业余。\n- **需要海量训练数据**：为了训练一个稳定的风格迁移模型，通常需要准备成百上千张风格一致的图片，而客户只提供了寥寥几张参考图，根本无法满足传统模型的训练需求。\n- **制作周期漫长且成本高**：要么花费数天时间手动调整每一帧，要么投入大量资源去收集或制作更多风格图片并重新训练模型，无法满足客户“本周内出片”的紧急需求。\n- **风格控制不精确**：客户希望风格化主要集中在产品主体上，背景稍作处理即可。但通用工具往往“一刀切”，整个画面的笔触和色彩变化过于均匀，无法突出产品重点。\n\n### 使用 Few-Shot-Patch-Based-Training 后\n- **实现快速、稳定的少样本风格学习**：仅需5张风格参考图片和一小段视频，通过其基于补丁的训练方法，能在短时间内学习到风格的本质特征，并稳定地应用到整个视频序列上。\n- **获得高时间一致性的输出**：该方法生成的视频帧间闪烁和抖动大幅减少，即使面对手持拍摄带有轻微抖动的原始素材，也能输出视觉上连贯、流畅的风格化视频。\n- **大幅缩短项目交付周期**：从准备素材到生成初步风格化结果，可以在几小时内完成，允许团队快速迭代，根据客户反馈调整风格强度或局部效果，最终在一天内交付高质量成片。\n- **实现局部化与可控的风格应用**：通过其交互式训练机制，可以引导模型将风格特征更集中地应用于视频中的特定区域（如产品本身），使背景处理相对 subtle，从而精准满足客户突出产品主体的创意要求。\n\n该工具的核心价值在于，它让资源有限的小团队也能利用极少的风格样本，快速生产出具有专业级时间一致性和艺术可控性的风格化视频，将原本高门槛的定制化视频艺术处理变成了一个高效、可迭代的轻量级工作流程。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FOndrejTexler_Few-Shot-Patch-Based-Training_5d0aa617.gif","OndrejTexler","Ondrej Texler","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FOndrejTexler_58a37698.jpg","GenAI Researcher at HeyGen","HeyGen","San Jose, California","ondrej.texler@gmail.com",null,"https:\u002F\u002Fondrejtexler.github.io\u002F","https:\u002F\u002Fgithub.com\u002FOndrejTexler",[86,90,94,98,102],{"name":87,"color":88,"percentage":89},"C++","#f34b7d",92.4,{"name":91,"color":92,"percentage":93},"C","#555555",6.2,{"name":95,"color":96,"percentage":97},"Python","#3572A5",1.2,{"name":99,"color":100,"percentage":101},"Objective-C","#438eff",0.1,{"name":103,"color":104,"percentage":101},"Batchfile","#C1F12E",627,106,"2026-02-19T16:33:55","Windows, Linux, macOS","需要 NVIDIA GPU（支持 CUDA），CUDA 10.2，设备示例为 cuda:0","未说明",{"notes":112,"python":113,"dependencies":114},"1. 测试环境为 Windows 10，但 Linux\u002FmacOS 也可运行；2. 训练和生成脚本支持 GPU（--device cuda:0）；3. 如需时间一致性处理（可选），需额外编译工具（disflow、bilateralAdv、gauss），Windows 有预编译版本；4. 需下载测试数据（testing-data.zip）和预训练模型（可选）；5. TensorFlow 仅用于日志记录，未来会移除","3.7.8",[115,116,117,118,119,120,121,122,123],"torch==1.6.0","torchvision==0.7.0","opencv-python==4.4.0.40","numpy==1.19.1","Pillow==7.2.0","scikit-image==0.17.2","scipy==1.5.2","PyYAML==5.3.1","tensorflow==1.15.3",[13,14,26],[126,127,128,129,130,131,132],"deep-learning","generative-adversarial-network","style-transfer","gan","image-generation","image-to-image-translation","pytorch","2026-03-27T02:49:30.150509","2026-04-06T07:13:52.064298",[136,141,146,151,156,161,166,170],{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},3764,"如何关闭掩码（mask）输入的使用？","掩码层不是必需的。要关闭它，您需要修改配置文件（YAML）中的相关设置，并可能需要调整代码。仅仅注释掉配置文件中的掩码目录行可能不够。如果希望完全移除掩码，可能需要修改 data.py、trainers.py 和 train.py 等文件中的代码，以移除对掩码层的调用。建议仔细检查数据加载和处理流程，确保所有对掩码的引用都被正确处理。","https:\u002F\u002Fgithub.com\u002FOndrejTexler\u002FFew-Shot-Patch-Based-Training\u002Fissues\u002F9",{"id":142,"question_zh":143,"answer_zh":144,"source_url":145},3765,"使用预训练权重时，如何将风格从一张图像转移到另一张图像？","是的，可以使用预训练权重进行风格迁移。您需要将包含所需风格的图像放在 `data_root` 文件夹中，并将要转换风格的图像放在输出文件夹中。网络不需要重新训练，只需一个风格示例帧即可，正如演示视频中所示。确保按照 README 中的说明正确设置配置和路径。","https:\u002F\u002Fgithub.com\u002FOndrejTexler\u002FFew-Shot-Patch-Based-Training\u002Fissues\u002F8",{"id":147,"question_zh":148,"answer_zh":149,"source_url":150},3766,"训练时出现“FileNotFoundError: No such file or directory: 'Zuzka2_train\u002Finput_filtered'”错误怎么办？","这个错误通常是因为数据文件缺失或路径不正确。请检查您运行脚本的目录中是否存在 `Zuzka2_train` 文件夹，并且该文件夹位于仓库的根目录下（与 `_config` 文件夹同级）。另外，请确保您已经解压了提供的测试数据文件（如 TEST_DATA.zip）。正确的数据准备是解决此问题的关键。","https:\u002F\u002Fgithub.com\u002FOndrejTexler\u002FFew-Shot-Patch-Based-Training\u002Fissues\u002F10",{"id":152,"question_zh":153,"answer_zh":154,"source_url":155},3767,"是否有预训练的模型权重可供下载？","是的，维护者已经发布了预训练模型。您可以在项目的 GitHub 仓库中查找最新发布的 .pth 模型文件，并参考更新后的 README.md 文件获取下载和使用说明。预训练模型便于快速评估和测试，无需从头开始训练。","https:\u002F\u002Fgithub.com\u002FOndrejTexler\u002FFew-Shot-Patch-Based-Training\u002Fissues\u002F1",{"id":157,"question_zh":158,"answer_zh":159,"source_url":160},3768,"如何为视频生成更平滑、时间一致的结果？","项目已更新，提供了处理时间不稳定性的工具。请参考 README.md 中的“Temporal Consistency [Optional]”章节。这些工具可以帮助减少帧间的闪烁。如果问题是指时间闪烁，使用提供的双边滤波器（Bilateral Filters）和高斯（Gauss）额外输入可能会有所帮助。此外，尝试使用实例分割图作为另一个额外输入也可能改善效果。","https:\u002F\u002Fgithub.com\u002FOndrejTexler\u002FFew-Shot-Patch-Based-Training\u002Fissues\u002F7",{"id":162,"question_zh":163,"answer_zh":164,"source_url":165},3769,"是否必须使用 CUDA？能否在 CPU 上运行？","项目主要设计为在支持 CUDA 的 GPU 上运行以获得最佳性能。尝试在 CPU 上运行（例如使用 `--device cpu` 参数）可能会因为缺少 fp16 支持或其他 GPU 特定优化而失败。如果您的环境只有 CPU，可能需要修改代码以移除对半精度（fp16）或特定 GPU 操作的依赖。但请注意，这可能会影响功能或性能，且非官方支持。","https:\u002F\u002Fgithub.com\u002FOndrejTexler\u002FFew-Shot-Patch-Based-Training\u002Fissues\u002F3",{"id":167,"question_zh":168,"answer_zh":169,"source_url":145},3770,"如何调整超参数以改善结果或适应不同场景？","如果网络在您的特定场景下产生伪影或效果不佳，可以尝试调整超参数。关键的超参数位于配置文件（如 `_config\u002Freference_P.yaml`）中。建议调整的参数包括：过滤器数量（filters）、补丁大小（patch_size）、批量大小（batch_size）等。您可以通过创建多个配置文件并批量运行 `train.py` 来进行实验。为了简化实验，您还可以考虑将一些在 YAML 文件中定义的参数暴露到 `train.py` 的命令行参数列表中。",{"id":171,"question_zh":172,"answer_zh":173,"source_url":140},3771,"训练时间越长，输出闪烁越明显怎么办？","这是一个已知的挑战。随着训练时间增加，输出质量可能提升，但时间闪烁也可能变得更明显。除了使用项目中提供的双边滤波器和高斯输入工具外，您还可以尝试使用实例分割图作为额外的辅助输入通道进行训练。这可能会提供更稳定的信息。如果这些方法仍不能完全解决问题，可能需要对网络架构或输入数据格式进行更复杂的修改，例如考虑使用多尺度生成器。",[]]