[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-70812":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":16,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":20,"hasPages":18,"topics":21,"createdAt":10,"pushedAt":10,"updatedAt":22,"readmeContent":23,"aiSummary":24,"trendingCount":16,"starSnapshotCount":16,"syncStatus":25,"lastSyncTime":26,"discoverSource":27},70812,"deep-photo-styletransfer","luanfujun\u002Fdeep-photo-styletransfer","luanfujun","Code and data for paper \"Deep Photo Style Transfer\": https:\u002F\u002Farxiv.org\u002Fabs\u002F1703.07511 ","",null,"MATLAB",9995,1380,417,31,0,62.42,false,"master",true,[],"2026-06-12 04:00:57","# deep-photo-styletransfer\nCode and data for paper \"[Deep Photo Style Transfer](https:\u002F\u002Farxiv.org\u002Fabs\u002F1703.07511)\"\n\n## Disclaimer \n**This software is published for academic and non-commercial use only.**\n\n## Setup\nThis code is based on torch. It has been tested on Ubuntu 14.04 LTS.\n\nDependencies:\n* [Torch](https:\u002F\u002Fgithub.com\u002Ftorch\u002Ftorch7) (with [matio-ffi](https:\u002F\u002Fgithub.com\u002Fsoumith\u002Fmatio-ffi.torch) and [loadcaffe](https:\u002F\u002Fgithub.com\u002Fszagoruyko\u002Floadcaffe))\n* [Matlab](https:\u002F\u002Fwww.mathworks.com\u002F) or [Octave](https:\u002F\u002Fwww.gnu.org\u002Fsoftware\u002Foctave\u002F)\n\nCUDA backend:\n* [CUDA](https:\u002F\u002Fdeveloper.nvidia.com\u002Fcuda-downloads)\n* [cudnn](https:\u002F\u002Fdeveloper.nvidia.com\u002Fcudnn)\n\nDownload VGG-19:\n```\nsh models\u002Fdownload_models.sh\n```\n\nCompile ``cuda_utils.cu`` (Adjust ``PREFIX`` and ``NVCC_PREFIX`` in ``makefile`` for your machine):\n```\nmake clean && make\n```\n\n## Usage\n### Quick start\nTo generate all results (in ``examples\u002F``) using the provided scripts, simply run\n```\nrun('gen_laplacian\u002Fgen_laplacian.m')\n```\nin Matlab or Octave and then\n```\npython gen_all.py\n```\nin Python. The final output will be in ``examples\u002Ffinal_results\u002F``.\n\n### Basic usage\n1. Given input and style images with semantic segmentation masks, put them in ``examples\u002F`` respectively. They will have the following filename form: ``examples\u002Finput\u002Fin\u003Cid>.png``, ``examples\u002Fstyle\u002Ftar\u003Cid>.png`` and ``examples\u002Fsegmentation\u002Fin\u003Cid>.png``, ``examples\u002Fsegmentation\u002Ftar\u003Cid>.png``;\n2. Compute the matting Laplacian matrix using ``gen_laplacian\u002Fgen_laplacian.m`` in Matlab. The output matrix will have the following filename form: ``gen_laplacian\u002FInput_Laplacian_3x3_1e-7_CSR\u003Cid>.mat``; \n\n**Note: Please make sure that the content image resolution is consistent for Matting Laplacian computation in Matlab and style transfer in Torch, otherwise the result won't be correct.**\n\n3. Run the following script to generate segmented intermediate result:\n```\nth neuralstyle_seg.lua -content_image \u003Cinput> -style_image \u003Cstyle> -content_seg \u003CinputMask> -style_seg \u003CstyleMask> -index \u003Cid> -serial \u003Cintermediate_folder>\n```\n4. Run the following script to generate final result:\n```\nth deepmatting_seg.lua -content_image \u003Cinput> -style_image \u003Cstyle> -content_seg \u003CinputMask> -style_seg \u003CstyleMask> -index \u003Cid> -init_image \u003Cintermediate_folder\u002Fout\u003Cid>_t_1000.png> -serial \u003Cfinal_folder> -f_radius 15 -f_edge 0.01\n```\n\nYou can pass `-backend cudnn` and `-cudnn_autotune` to both Lua scripts (step 3.\nand 4.) to potentially improve speed and memory usage. `libcudnn.so` must be in\nyour `LD_LIBRARY_PATH`. This requires [cudnn.torch](https:\u002F\u002Fgithub.com\u002Fsoumith\u002Fcudnn.torch).\n\n### Image segmentation\n\nNote: In the main paper we generate all comparison results using automatic scene segmentation algorithm modified from [DilatedNet](https:\u002F\u002Farxiv.org\u002Fabs\u002F1606.00915). Manual segmentation enables more diverse tasks hence we provide the masks in ``examples\u002Fsegmentation\u002F``.\n\nThe mask colors we used (you could add more colors in `ExtractMask` function in two `*.lua` files):\n\n| Color variable  | RGB Value | Hex Value | \n| ------------- | ------------- | ------------- |\n| `blue`  | `0 0 255`  | `0000ff`  | \n| `green`  | `0 255 0`  | `00ff00`  |\n| `black`  | `0 0 0`  | `000000`  |\n| `white`  | `255 255 255`  | `ffffff`  |\n| `red`  | `255 0 0`  | `ff0000`  |\n| `yellow`  | `255 255 0`  | `ffff00`  |\n| `grey`  | `128 128 128`  | `808080`  |\n| `lightblue`  | `0 255 255`  | `00ffff`  |\n| `purple`  | `255 0 255`  | `ff00ff ` |\n\nHere are some automatic and manual tools for creating a segmentation mask for a photo image:\n\n#### Automatic:\n* [MIT Scene Parsing](http:\u002F\u002Fsceneparsing.csail.mit.edu\u002F)\n* [SuperParsing](http:\u002F\u002Fwww.cs.unc.edu\u002F~jtighe\u002FPapers\u002FECCV10\u002F)\n* [Nonparametric Scene Parsing](http:\u002F\u002Fpeople.csail.mit.edu\u002Fceliu\u002FLabelTransfer\u002F)\n* [Berkeley Contour Detection and Image Segmentation Resources](https:\u002F\u002Fwww2.eecs.berkeley.edu\u002FResearch\u002FProjects\u002FCS\u002Fvision\u002Fgrouping\u002Fresources.html)\n* [CRF-RNN for Semantic Image Segmentation](https:\u002F\u002Fgithub.com\u002Ftorrvision\u002Fcrfasrnn)\n* [Selective Search](https:\u002F\u002Fgithub.com\u002Fbelltailjp\u002Fselective_search_py)\n* [DeepLab-TensorFlow](https:\u002F\u002Fgithub.com\u002FDrSleep\u002Ftensorflow-deeplab-lfov)\n\n#### Manual:\n* [Photoshop Quick Selection Tool](https:\u002F\u002Fhelpx.adobe.com\u002Fphotoshop\u002Fusing\u002Fmaking-quick-selections.html)\n* [GIMP Selection Tool](https:\u002F\u002Fdocs.gimp.org\u002Fen\u002Fgimp-tools-selection.html)\n* [GIMP G'MIC Interactive Foreground Extraction tool](http:\u002F\u002Fgmic.eu\u002Fgimp.shtml)\n\n## Examples\nHere are some results from our algorithm (from left to right are input, style and our output):\n\u003Cp align='center'>\n  \u003Cimg src='examples\u002Finput\u002Fin3.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Fstyle\u002Ftar3.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Frefine_posterization\u002Frefine_3.png' height='194' width='290'\u002F>\n\u003C\u002Fp>\n\n\u003Cp align='center'>\n  \u003Cimg src='examples\u002Finput\u002Fin4.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Fstyle\u002Ftar4.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Frefine_posterization\u002Frefine_4.png' height='194' width='290'\u002F>\n\u003C\u002Fp>\n\n\u003Cp align='center'>\n  \u003Cimg src='examples\u002Finput\u002Fin13.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Fstyle\u002Ftar13.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Frefine_posterization\u002Frefine_13.png' height='194' width='290'\u002F>\n\u003C\u002Fp>\n\n\u003Cp align='center'>\n  \u003Cimg src='examples\u002Finput\u002Fin9.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Fstyle\u002Ftar9.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Frefine_posterization\u002Frefine_9.png' height='194' width='290'\u002F>\n\u003C\u002Fp>\n\n\u003Cp align='center'>\n  \u003Cimg src='examples\u002Finput\u002Fin20.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Fstyle\u002Ftar20.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Frefine_posterization\u002Frefine_20.png' height='194' width='290'\u002F>\n\u003C\u002Fp>\n\n\u003Cp align='center'>\n  \u003Cimg src='examples\u002Finput\u002Fin1.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Fstyle\u002Ftar1.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Frefine_posterization\u002Frefine_1.png' height='194' width='290'\u002F>\n\u003C\u002Fp>\n\n\u003Cp align='center'>\n  \u003Cimg src='examples\u002Finput\u002Fin39.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Fstyle\u002Ftar39.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Frefine_posterization\u002Frefine_39.png' height='194' width='290'\u002F>\n\u003C\u002Fp>\n\n\u003Cp align='center'>\n  \u003Cimg src='examples\u002Finput\u002Fin57.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Fstyle\u002Ftar57.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Frefine_posterization\u002Frefine_57.png' height='194' width='290'\u002F>\n\u003C\u002Fp>\n\n\u003Cp align='center'>\n  \u003Cimg src='examples\u002Finput\u002Fin47.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Fstyle\u002Ftar47.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Frefine_posterization\u002Frefine_47.png' height='194' width='290'\u002F>\n\u003C\u002Fp>\n\n\u003Cp align='center'>\n  \u003Cimg src='examples\u002Finput\u002Fin58.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Fstyle\u002Ftar58.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Frefine_posterization\u002Frefine_58.png' height='194' width='290'\u002F>\n\u003C\u002Fp>\n\n\u003Cp align='center'>\n  \u003Cimg src='examples\u002Finput\u002Fin51.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Fstyle\u002Ftar51.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Frefine_posterization\u002Frefine_51.png' height='194' width='290'\u002F>\n\u003C\u002Fp>\n\n\u003Cp align='center'>\n  \u003Cimg src='examples\u002Finput\u002Fin7.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Fstyle\u002Ftar7.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Frefine_posterization\u002Frefine_7.png' height='194' width='290'\u002F>\n\u003C\u002Fp>\n\n\u003Cp align='center'>\n  \u003Cimg src='examples\u002Finput\u002Fin23.png' width='290'\u002F>\n  \u003Cimg src='examples\u002Finput\u002Fin23.png' width='290'\u002F>\n  \u003Cimg src='examples\u002Ffinal_results\u002Fbest23_t_1000.png' width='290'\u002F>\n\u003C\u002Fp>\n\n\u003Cp align='center'>\n  \u003Cimg src='examples\u002Finput\u002Fin16.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Fstyle\u002Ftar16.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Frefine_posterization\u002Frefine_16.png' height='194' width='290'\u002F>\n\u003C\u002Fp>\n\n\u003Cp align='center'>\n  \u003Cimg src='examples\u002Finput\u002Fin30.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Fstyle\u002Ftar30.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Frefine_posterization\u002Frefine_30.png' height='194' width='290'\u002F>\n\u003C\u002Fp>\n\n\u003Cp align='center'>\n  \u003Cimg src='examples\u002Finput\u002Fin2.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Fstyle\u002Ftar2.png' height='194' width='290'\u002F>\n  \u003Cimg src='examples\u002Ffinal_results\u002Fbest2_t_1000.png' height='194' width='290'\u002F>\n\u003C\u002Fp>\n\n\u003Cp align='center'>\n  \u003Cimg src='examples\u002Finput\u002Fin11.png'  width='290'\u002F>\n  \u003Cimg src='examples\u002Fstyle\u002Ftar11.png' width='290'\u002F>\n  \u003Cimg src='examples\u002Frefine_posterization\u002Frefine_11.png'  width='290'\u002F>\n\u003C\u002Fp>\n\n\n## Acknowledgement\n* Our torch implementation is based on Justin Johnson's [code](https:\u002F\u002Fgithub.com\u002Fjcjohnson\u002Fneural-style);\n* We use Anat Levin's Matlab [code](http:\u002F\u002Fwww.wisdom.weizmann.ac.il\u002F~levina\u002Fmatting.tar.gz) to compute the matting Laplacian matrix.\n\n## Citation\nIf you find this work useful for your research, please cite:\n```\n@article{luan2017deep,\n  title={Deep Photo Style Transfer},\n  author={Luan, Fujun and Paris, Sylvain and Shechtman, Eli and Bala, Kavita},\n  journal={arXiv preprint arXiv:1703.07511},\n  year={2017}\n}\n```\n\n## Contact\nFeel free to contact me if there is any question (Fujun Luan fl356@cornell.edu).\n\n","该项目实现了深度照片风格迁移技术，能够将一张图片的内容与另一张图片的风格相结合。其核心功能是通过使用Torch框架和MATLAB或Octave环境，基于VGG-19模型来处理图像，并支持CUDA加速以提高性能。项目特别强调了对于内容和风格图像进行语义分割的重要性，以保证风格迁移时局部细节的一致性。适用于需要高质量图像风格转换的研究场景或是对图像艺术效果有高要求的应用开发中，如摄影后期处理、数字艺术创作等。注意，此软件仅供学术及非商业用途。",2,"2026-06-11 03:34:20","high_star"]