在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:fast-style-transfer开源软件地址:https://gitee.com/martin_z_he/fast-style-transfer开源软件介绍:Fast Style Transfer in TensorFlowAdd styles from famous paintings to any photo in a fraction of a second! You can even style videos! It takes 100ms on a 2015 Titan X to style the MIT Stata Center (1024×680) like Udnie, by Francis Picabia. Our implementation is based off of a combination of Gatys' A Neural Algorithm of Artistic Style, Johnson's Perceptual Losses for Real-Time Style Transfer and Super-Resolution, and Ulyanov's Instance Normalization. SponsorshipPlease consider sponsoring my work on this project! LicenseCopyright (c) 2016 Logan Engstrom. Contact me for commercial use (or rather any use that is not academic research) (email: engstrom at my university's domain dot edu). Free for research use, as long as proper attribution is given and this copyright notice is retained. Video StylizationHere we transformed every frame in a video, then combined the results. Click to go to the full demo on YouTube! The style here is Udnie, as above. See how to generate these videos here! Image StylizationWe added styles from various paintings to a photo of Chicago. Click on thumbnails to see full applied style images. Implementation DetailsOur implementation uses TensorFlow to train a fast style transfer network. We use roughly the same transformation network as described in Johnson, except that batch normalization is replaced with Ulyanov's instance normalization, and the scaling/offset of the output Vitual Environment Setup (Anaconda) - Windows/LinuxTested on
Step 1:Install Anacondahttps://docs.anaconda.com/anaconda/install/ Step 2:Build a virtual environmentRun the following commands in sequence in Anaconda Prompt: conda create -n tf-gpu tensorflow-gpu=2.1.0conda activate tf-gpuconda install jupyterlabjupyter lab Run the following command in the notebook or just conda install the package: !pip install moviepy==1.0.2 Follow the commands below to use fast-style-transfer DocumentationTraining Style Transfer NetworksUse python style.py --style path/to/style/img.jpg \ --checkpoint-dir checkpoint/path \ --test path/to/test/img.jpg \ --test-dir path/to/test/dir \ --content-weight 1.5e1 \ --checkpoint-iterations 1000 \ --batch-size 20 Evaluating Style Transfer NetworksUse python evaluate.py --checkpoint path/to/style/model.ckpt \ --in-path dir/of/test/imgs/ \ --out-path dir/for/results/ Stylizing VideoUse python transform_video.py --in-path path/to/input/vid.mp4 \ --checkpoint path/to/style/model.ckpt \ --out-path out/video.mp4 \ --device /gpu:0 \ --batch-size 4 RequirementsYou will need the following to run the above:
Citation @misc{engstrom2016faststyletransfer, author = {Logan Engstrom}, title = {Fast Style Transfer}, year = {2016}, howpublished = {\url{https://github.com/lengstrom/fast-style-transfer/}}, note = {commit xxxxxxx} } Attributions/Thanks
Related Work
|
请发表评论