diff options
| -rw-r--r-- | README.md | 10 | ||||
| -rw-r--r-- | examples/lions/kandinsky_output.png | bin | 641004 -> 608539 bytes | |||
| -rw-r--r-- | neural_style.py | 6 |
3 files changed, 9 insertions, 7 deletions
@@ -30,7 +30,7 @@ Transferring the style of various artworks to the same content image produces qu <img src="examples/lions/styles/basquiat_crop.jpg" width="192"/> </p> -Here we reproduce Figure 3 from the first paper, which renders a photograph of the Neckar river in Tübingen, Germany in the style of 5 different iconic paintings [The Shipwreck of the Minotaur](http://www.artble.com/artists/joseph_mallord_william_turner/paintings/the_shipwreck_of_the_minotaur), [The Starry Night](https://www.wikiart.org/en/vincent-van-gogh/the-starry-night-1889), [Composition VII](https://www.wikiart.org/en/wassily-kandinsky/composition-vii-1913), [The Scream](https://www.wikiart.org/en/edvard-munch/the-scream-1893), [Seated Nude](http://www.pablopicasso.org/seated-nude.jsp): +Here we reproduce Figure 3 from the first paper, which renders a photograph of the Neckarfront in Tübingen, Germany in the style of 5 different iconic paintings [The Shipwreck of the Minotaur](http://www.artble.com/artists/joseph_mallord_william_turner/paintings/the_shipwreck_of_the_minotaur), [The Starry Night](https://www.wikiart.org/en/vincent-van-gogh/the-starry-night-1889), [Composition VII](https://www.wikiart.org/en/wassily-kandinsky/composition-vii-1913), [The Scream](https://www.wikiart.org/en/edvard-munch/the-scream-1893), [Seated Nude](http://www.pablopicasso.org/seated-nude.jsp): <p align="center"> <img src="examples/gatys_figure/tubingen.png" height="192px"> <img src="examples/gatys_figure/tubingen_shipwreck.png" height="192px"> @@ -153,9 +153,13 @@ Animations can be rendered by applying the algorithm to each source frame. For <p align="center"> <img src="examples/video/input.gif"> - +<img src="examples/video/opt_flow.gif"> +<br> +<img src="examples/video/weights.gif"> <img src="examples/video/output.gif"> -</p> +</p> +*Top row (left to right)*: source frames, ground-truth optical flow visualized +*Bottom row (left to right)*: disoccluded regions and motion boundaries, stylized frames ### Gradient Descent Initialization The initialization of the gradient descent is controlled using `--init_img_type` for single images and `--init_frame_type` or `--first_frame_type` for video frames. White noise allows an arbitrary number of distinct images to be generated. Whereas, initializing with a fixed image always converges to the same output. diff --git a/examples/lions/kandinsky_output.png b/examples/lions/kandinsky_output.png Binary files differindex 9d47226..2174d42 100644 --- a/examples/lions/kandinsky_output.png +++ b/examples/lions/kandinsky_output.png diff --git a/neural_style.py b/neural_style.py index e199678..62875f6 100644 --- a/neural_style.py +++ b/neural_style.py @@ -551,7 +551,7 @@ def normalize(weights): denom = sum(weights) if denom > 0.: return [float(i) / denom for i in weights] - else: return [0.] + else: return [0. for _ in weights] def maybe_make_directory(dir_path): if not os.path.exists(dir_path): @@ -792,8 +792,6 @@ def get_content_weights(frame, prev_frame): backward_path = os.path.join(args.video_input_dir, backward_fn) forward_weights = read_weights_file(forward_path) backward_weights = read_weights_file(backward_path) - forward_weights = np.clip(forward_weights, 0, 255).astype('uint8') - backward_weights = np.clip(backward_weights, 0, 255).astype('uint8') return forward_weights #, backward_weights def warp_image(src, flow): @@ -874,4 +872,4 @@ def main(): else: render_single_image() if __name__ == '__main__': - main()
\ No newline at end of file + main() |
