Week 09 – Train and Inference a ml5js Style Transfer model

The setup for this project took much longer than expected – mostly because the 14GB Coco dataset took around ~4.5 hours and three retries to actually download properly. Once that was done, the rest was pretty straightforward. 
For this project, I went with a Pokemon theme again (why not?). My idea was to train the network with one of my favorite wallpapers and then, when it transfers the style onto the video feed, it plays back the Pokemon theme song. 
This is the image. 
pokemon

The only bottleneck in the entire process was the actual training process which took something between 15-20 hours on the cluster. I didn’t encounter any trouble with the actual training, but the qstat command on the cluster would return very weird running times which I’ve attached below for reference.

Train time

According to qstat, I had been training the model for 324 hours which was completely off. In any case, I attached it above just in case someone else had the same observation.

Once the weights were set, the p5js implementation was straightforward since we did the code in class. 
Here’s a video of the model in action. 

For a basic style transfer example, I was quite satisfied with the result, considering the fact that the model trained in a relatively short time compared to more advanced GAN models. Neural Style Transfer is something I’m definitely going to explore a bit more in-depth after this project. 

The code can be found in this repo here.

Leave a Reply