Building custom layers in Swift
In this section, we will be mainly focusing on implementing the custom layers that our model is dependent on, and we'll omit a lot of the application's details by working with an existing template—a structure you have no doubt become quite familiar with.
If you haven't done so already, pull down the latest code from the accompanying repository: https://github.com/packtpublishing/machine-learning-with-core-ml. Once downloaded, navigate to the directory Chapter6/Start/StyleTransfer/
and open the project StyleTransfer.xcodeproj
. Once loaded, you will see the project for this chapter:
![](https://static.packt-cdn.com/products/9781788838290/graphics/392c3155-d2cd-4ac7-94fd-dd976c6f5faf.png)
The application consists of two view controllers. The first, CameraViewController
, provides the user with a live stream of the camera and the ability to take a photo. When a photo is taken, the controller presents the other view controller, StyleTransferViewController
, passing along with the captured photo. StyleTransferViewController
then presents the image, along with a horizontal...