title: Swift : Convert byte array into CIImage
body: <p>I am looking for a way to convert a byte array to CIIimage so that I can feed it into a ML model for classification. I am using a REST HTTP server, where I send a POST request to the server with payload as the image. The image bytes received by the server needs to be processed and converted into a CIImage format for MAC OS  so that it can be fed into a ML model which accepts requests of type <code>VNImageRequestHandler(ciImage: &lt;ciimage&gt;)</code>. </p>
  
  <p>Could someone give an example to do this in swift ?</p>
  
  <p><code>VNImageRequestHandler : NSObject</code></p>
  
  <p><code>let data = Data(bytes)
  let imgHandler = VNImageRequestHandler(ciImage: data)
  </code>
  The above data variable needs to be typecased to be of type <code>CIImage</code>. </p>
  
  <p>On the HTTP server side, I am receiving the bytes of the image like this:
  <code>imageData = request.body.bytes</code></p>