/

/

Parallel Neural Styles on Video Powered by Azure

/

/

Parallel Neural Styles on Video Powered by Azure

Parallel Neural Styles on Video Powered by Azure

Parallel Neural Styles on Video Powered by Azure

Date Published

Feb 18, 2018

Feb 18, 2018

Contributors

Share

Share

Date Published

Feb 18, 2018

Contributors

Share

The above video was generated with the help of an algorithm called Neural Styles. It is an algorithm based on neural networks that is used to learn artistic styles and happens to be commonly used in apps like Prisma to beautify images. The algorithm extracts features from a "style image" and then applies it to a "content image". Since a video is basically a collection of frames, we were able to apply our algorithm to every frame. This is the original video which we took as input to our model:

In a previous blog post, we described the model in neural styles and outlined the training process. We have now scaled our algorithm from individual images to video, using Julia's built-in parallel primitives that make it trivially easy it is to scale algorithms to multiple nodes.

We ran the transformation on an Azure Data Science VM. The Azure DSVM is a pre-built image with many data science libraries included. It contains an installation of JuliaPro, and includes over a 100 major Julia packages. It is by far the easiest way to get started with running Julia code on the Azure ecosystem.

Our VM came with an Intel(R) Xeon(R) CPU E5-2660 with 8 physical cores and 56 GB RAM. We first extracted the frames from the video with VideoIO.jl, and then processed them in parallel with 8 Julia worker processes. Julia has several high level primitives for distributed computing, and we used the parallel map pmap function to split the images amongst the workers and subsequently texturize them. For larger videos, exactly the same code would be used to run this on a cluster of multiple physical or virtual servers.

@everywhere function f(a)
        texturize(a, "fire", "style")
end

pmap(x -> f(x), frames_from_video

After the parallel processing, we stitched the images back together via ffmpeg to form a video.

The first video of this article was the output of passing the original video through a model we call "fire", due to the fiery texture that was transferred. Here's the result of passing through another model called "frost":

Tags

Tags

Tags

Authors

Dr. Ranjan Anantharaman is a Sales Engineer at JuliaHub Inc, specializing in JuliaSim's modeling and simulation offerings. He has a PhD in Mathematics & Computational Science from MIT and his expertise lies in shaping the future of simulation workflows with scientific machine learning. Ranjan collaborates with engineering firms, leveraging his background in surrogate modeling for high-dimensional dynamical systems developed at JuliaLab (MIT CSAIL). He has actively contributed to the Julia community, chairing JuliaCon since 2020.

Authors

Dr. Ranjan Anantharaman is a Sales Engineer at JuliaHub Inc, specializing in JuliaSim's modeling and simulation offerings. He has a PhD in Mathematics & Computational Science from MIT and his expertise lies in shaping the future of simulation workflows with scientific machine learning. Ranjan collaborates with engineering firms, leveraging his background in surrogate modeling for high-dimensional dynamical systems developed at JuliaLab (MIT CSAIL). He has actively contributed to the Julia community, chairing JuliaCon since 2020.

Authors

Dr. Ranjan Anantharaman is a Sales Engineer at JuliaHub Inc, specializing in JuliaSim's modeling and simulation offerings. He has a PhD in Mathematics & Computational Science from MIT and his expertise lies in shaping the future of simulation workflows with scientific machine learning. Ranjan collaborates with engineering firms, leveraging his background in surrogate modeling for high-dimensional dynamical systems developed at JuliaLab (MIT CSAIL). He has actively contributed to the Julia community, chairing JuliaCon since 2020.

Learn about Dyad

Get Dyad Studio – Download and install the IDE to start building hardware like software.

Read the Dyad Documentation – Dive into the language, tools, and workflow.

Join the Dyad Community – Connect with fellow engineers, ask questions, and share ideas.

Learn about Dyad

Get Dyad Studio – Download and install the IDE to start building hardware like software.

Read the Dyad Documentation – Dive into the language, tools, and workflow.

Join the Dyad Community – Connect with fellow engineers, ask questions, and share ideas.

Contact Us

Want to get enterprise support, schedule a demo, or learn about how we can help build a custom solution? We are here to help.

Contact Us

Want to get enterprise support, schedule a demo, or learn about how we can help build a custom solution? We are here to help.