public class ImageSchema
extends Object
Constructor and Description |
---|
ImageSchema() |
Modifier and Type | Method and Description |
---|---|
static StructType |
columnSchema()
Schema for the image column: Row(String, Int, Int, Int, Int, Array[Byte])
|
static byte[] |
getData(Row row)
Gets the image data
|
static int |
getHeight(Row row)
Gets the height of the image
|
static int |
getMode(Row row)
Gets the OpenCV representation as an int
|
static int |
getNChannels(Row row)
Gets the number of channels in the image
|
static String |
getOrigin(Row row)
Gets the origin of the image
|
static int |
getWidth(Row row)
Gets the width of the image
|
static String[] |
imageFields() |
static StructType |
imageSchema()
DataFrame with a single column of images named "image" (nullable)
|
static java.util.Map<String,Object> |
javaOcvTypes()
(Java-specific) OpenCV type mapping supported
|
static scala.collection.immutable.Map<String,Object> |
ocvTypes()
(Scala-specific) OpenCV type mapping supported
|
static Dataset<Row> |
readImages(String path)
Deprecated.
use `spark.read.format("image").load(path)` and this `readImages` will be removed in 3.0.0. Since 2.4.0.
|
static Dataset<Row> |
readImages(String path,
SparkSession sparkSession,
boolean recursive,
int numPartitions,
boolean dropImageFailures,
double sampleRatio,
long seed)
Deprecated.
use `spark.read.format("image").load(path)` and this `readImages` will be removed in 3.0.0. Since 2.4.0.
|
static String |
undefinedImageType() |
public static String undefinedImageType()
public static scala.collection.immutable.Map<String,Object> ocvTypes()
public static java.util.Map<String,Object> javaOcvTypes()
public static StructType columnSchema()
public static String[] imageFields()
public static StructType imageSchema()
public static String getOrigin(Row row)
row
- (undocumented)public static int getHeight(Row row)
row
- (undocumented)public static int getWidth(Row row)
row
- (undocumented)public static int getNChannels(Row row)
row
- (undocumented)public static int getMode(Row row)
row
- (undocumented)public static byte[] getData(Row row)
row
- (undocumented)public static Dataset<Row> readImages(String path)
path
- Path to the image directorypublic static Dataset<Row> readImages(String path, SparkSession sparkSession, boolean recursive, int numPartitions, boolean dropImageFailures, double sampleRatio, long seed)
path
- Path to the image directorysparkSession
- Spark Session, if omitted gets or creates the sessionrecursive
- Recursive path search flagnumPartitions
- Number of the DataFrame partitions,
if omitted uses defaultParallelism insteaddropImageFailures
- Drop the files that are not valid images from the resultsampleRatio
- Fraction of the files loadedseed
- (undocumented)