Extracting image metadata

Up too this point, we have loaded and pre-processed raw images, but we have no idea about the image metadata that we need to make our CNNs learn. Thus, it's time to load the CSV files that contain metadata about each image.

I wrote a method to read such metadata in CSV format, called readMetadata(), which is used later on by two other methods called readBusinessLabels and readBusinessToImageLabels. These three methods are defined in the CSVImageMetadataReader.scala script. Here's the signature of the readMetadata() method:

def readMetadata(csv: String, rows: List[Int]=List(-1)): List[List[String]] = {    val src = Source.fromFile(csv)    def reading(csv: String): List[List[String]]= { src.getLines.map(x => x.split(",").toList) ...

Get Scala Machine Learning Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.