xxxxxxxxxx
# Reading an Image file into a DataFrame
image_dir = "your_image_file_in_dir_location" #ex. "/databrics-datasets/learning-spark/cctvVideos/train_images/"
images_df = spark.read.format("image").load(image_dir)
images_df.printSchema()
images_df.select("image.height", "image.width", "image.nChannels", "image.mode", "label").show() # This parameter will show in schema above