All Projects → ProGamerGov → Neural-Zoom-Legacy

ProGamerGov / Neural-Zoom-Legacy

Licence: other
Infinite Zoom For Style Transfer

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Neural-Zoom-Legacy

Neural-Zoom
Infinite Zoom For Style Transfer
Stars: ✭ 34 (+142.86%)
Mutual labels:  infinite, zoom, neural-style, neural, neural-zoom
Neural-Tile
A better tiling script for Neural-Style
Stars: ✭ 35 (+150%)
Mutual labels:  style-transfer, neural-style, neural
Torch Models
Stars: ✭ 65 (+364.29%)
Mutual labels:  style-transfer, neural-style, neural
Neural Tools
Tools made for usage alongside artistic style transfer projects
Stars: ✭ 150 (+971.43%)
Mutual labels:  style-transfer, neural-style, neural
Adain Style
Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization
Stars: ✭ 1,049 (+7392.86%)
Mutual labels:  style-transfer, neural-style
Neural Style Pt
PyTorch implementation of neural style transfer algorithm
Stars: ✭ 456 (+3157.14%)
Mutual labels:  style-transfer, neural-style
Texture nets
Code for "Texture Networks: Feed-forward Synthesis of Textures and Stylized Images" paper.
Stars: ✭ 1,147 (+8092.86%)
Mutual labels:  style-transfer, neural-style
Neural Style Audio Torch
Torch implementation for audio neural style.
Stars: ✭ 130 (+828.57%)
Mutual labels:  style-transfer, neural-style
Style Transfer
A Keras Implementation of "A Neural Algorithm of Artistic Style"
Stars: ✭ 115 (+721.43%)
Mutual labels:  style-transfer, neural-style
Fast Style Transfer
TensorFlow CNN for fast style transfer ⚡🖥🎨🖼
Stars: ✭ 10,240 (+73042.86%)
Mutual labels:  style-transfer, neural-style
neural-style-pytorch
Neural Style implementation in PyTorch! 🎨
Stars: ✭ 50 (+257.14%)
Mutual labels:  style-transfer, neural-style
Neural Style Audio Tf
TensorFlow implementation for audio neural style.
Stars: ✭ 413 (+2850%)
Mutual labels:  style-transfer, neural-style
Tensorflow Style Transfer
A simple, concise tensorflow implementation of style transfer (neural style)
Stars: ✭ 278 (+1885.71%)
Mutual labels:  style-transfer, neural-style
Faststyle
Tensorflow implementation of fast neural style transfer.
Stars: ✭ 170 (+1114.29%)
Mutual labels:  style-transfer, neural-style
Tensorflow Fast Style Transfer
A simple, concise tensorflow implementation of fast style transfer
Stars: ✭ 224 (+1500%)
Mutual labels:  style-transfer, neural-style
MeuralPaint
TensorFlow implementation of CNN fast neural style transfer ⚡️ 🎨 🌌
Stars: ✭ 19 (+35.71%)
Mutual labels:  style-transfer, neural-style
Keras-Style-Transfer
An implementation of "A Neural Algorithm of Artistic Style" in Keras
Stars: ✭ 36 (+157.14%)
Mutual labels:  style-transfer, neural-style
Splice
Official Pytorch Implementation for "Splicing ViT Features for Semantic Appearance Transfer" presenting "Splice" (CVPR 2022)
Stars: ✭ 126 (+800%)
Mutual labels:  style-transfer
lovelace-plotly-graph-card
Highly customisable Lovelace card to display interactive graphs. Brings scrolling, zooming, and much more!
Stars: ✭ 38 (+171.43%)
Mutual labels:  zoom
CS231n
My solutions for Assignments of CS231n: Convolutional Neural Networks for Visual Recognition
Stars: ✭ 30 (+114.29%)
Mutual labels:  style-transfer

Neural-Zoom


Requirements

Neural-Style or a similar style transfer system.

ImageMagick can be installed on Ubuntu with:

sudo apt-get install imagemagick

FFmpeg for making gifs and mp4 format videos with ImageMagick:

sudo apt-get install ffmpeg


Usage

Copy this script to neural-style directory, then run:

./neural-zoom.sh input_file style_file zoom_value num_frames

An example of running the script would be:

./neural-zoom.sh input.jpg style.png 32 1000000

Or if you are using Fast-Neural-Style, run:

./fast-neural-zoom.sh input_file model_file zoom_value num_frames

The script is capable of continuing where you left off if it sees all the previous images up to where you stopped. So it can be a good idea to save all of the images it produces, so that you can always make your gifs/mp4 videos longer.

All of the frames after being run through Neural-Style can be found inside a folder the script creates called "output".

If you wish to continue where you left off, past the contents of the "output" which contains the uncropped images, into your Neural-Style directory. make sure you save the frames that are outputted into the Neural-Style directory in additon to the frames saved in the output directory. You can also continue where you left off by simply using your last frame as your new content image.


Arguments

zoom_value: The number of pixels subtracted from the width and height of your initial content image between each "frame".

num_frames: The total number of frames/images you want the script to create.

To adjust the normal style transfer parameters, you either change the Neural-Style parameters on lines 80-82 or the Fast-Neural-Style parameters on lines 81-82.


MP4/GIF Making:

First, use this bash script (modified from here) to rename your frames to have leading zeroes, so that ffmpeg will place them in the correct order. This script will clone all the frames into a new directory. (change it to mv if you don't want that, but, this is useful for postprocessing without editing the originals.)

Alter the script for the correct postfix for your content, and target directory for your system.

#!/bin/bash

postfix="_chicago.png"
targetDir="./renamed_frames"
paddingLength=8

for file in [0-9]*${postfix}; do

  # strip the postfix off the file name
  number=${file%$postfix}

  # copy to a new name with padded zeros in a new folder
  cp ${file} "$targetDir"/$(printf %0${paddingLength}d$postfix $number)

done

Next, navigate to your output directory and run:

convert *.png name.mp4

or

convert *.png name.gif


Troubleshooting

permission errors

If you face a permission error, try using chmod to fix the issue:

chmod u+x ./neural-zoom.sh
chmod u+x ./fast-neural-zoom.sh

cache resources exhausted

The tool ImageMagick is intended for network use, and so comes with a resource limit policy file to prevent attacks. The default policy file in some linuxes, such as ubuntu, has settings too small for image to video work.

This is probably the problem if you see errors of this form:

convert-im6.q16: DistributedPixelCache '127.0.0.1' @ error/distribute-cache.c/ConnectPixelCacheServer/244.
convert-im6.q16: cache resources exhausted `81_chicago.jpg' @ error/cache.c/OpenPixelCache/3945.

To fix this, alter your policy file. Assuming ImageMagick 6 and the text editor nano, you may

nano -w /etc/ImageMagick-6/policy.xml

Then, as described in this comment, near the top of the <policymap> tag, comment out the top block of subtags, the <policy> tags for temporary-path, memory, map, area, disk, file, thread, throttle, and time.

If this is on a server being used over the network, set to larger limits instead of commenting out.


Example Outputs

https://i.imgur.com/UCWl54o.gifv

Zoom value of 5:

https://i.imgur.com/1880gPU.gifv

Zoom value of 37.5:

https://gfycat.com/HighlevelThinIndianpangolin

GIMP Auto-Color: https://gfycat.com/AfraidAcademicGnu

Fast-Neural-Style out at 37.5 zoom:

https://i.imgur.com/Jkd7QZ0.gifv

Cosmic Zoom:

https://gfycat.com/SandySarcasticAphid


Known Issues

  • All the frames used for cropping, are dumped into your Neural-Style directory, while all the full sized frames are saved in their own folder/directory inside the Neural-Style directory called, "output".

  • If you start from where you left off, it may crop the orginal full sized frames, so always back up the folder containing the full sized frames before starting the script again. Because of this, the cropped frames seem to be able to be replaced by the non cropped frames, with no issue. Meaning you only have to save the uncropped frames.

  • Before making a gif or mp4 file with your frames, either resize image number 1, or delete it, so that all frames are the same size.


For editing all the frames at once with the same settings:

GIMP Plug-in: http://www.alessandrofrancesconi.it/projects/bimp/


Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].