fun main()

in vision/src/main/kotlin/Quickstart.kt [25:43]


fun main(args: Array<String>) {
    val imageFileName = if (args.isEmpty()) {
        "./resources/doggo.jpg" // Image file path
    } else {
        args[0] // grab args[0] for file
    }

    val imageFile = File(imageFileName)
    if (!imageFile.exists()) {
        throw NoSuchFileException(file = imageFile, reason = "The file you specified does not exist")
    }

    try {
        quickstart(imageFileName)
    } catch (e: IOException) {
        println("Image annotation failed:")
        println(e.message)
    }
}