public class AiliaFeatureExtractorModel
extends java.lang.Object
implements java.lang.AutoCloseable
Constructor and Description |
---|
AiliaFeatureExtractorModel(long netHandle,
AiliaNetworkImageFormat format,
AiliaNetworkImageChannel channel,
AiliaNetworkImageRange range,
java.lang.String layerName)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
close()
It destroys the feature extraction instance.
|
void |
compute(float[] dst,
byte[] src,
int srcStride,
int srcWidth,
int srcHeight,
AiliaImageFormat srcFormat)
Performs feature extraction.
|
float |
match(AiliaFeatureExtractorDistanceType distanceType,
float[] feature1,
float[] feature2)
Computes distances in feature space.
|
float |
match(int distanceType,
float[] feature1,
float[] feature2)
|
public AiliaFeatureExtractorModel(long netHandle, AiliaNetworkImageFormat format, AiliaNetworkImageChannel channel, AiliaNetworkImageRange range, java.lang.String layerName) throws AiliaException
netHandle
- A network instance handleformat
- The network image format (AiliaNetworkImageFormat
)channel
- The network image channel (AiliaNetworkImageChannel
)range
- The network image range (AiliaNetworkImageRange
)layerName
- The name of the layer corresponding to the feature (fc1 for VGG16 and NULL for the last layer)AiliaException
- ExceptionAiliaFeatureExtractor.Create(long, int, int, int, String)
public void close()
close
in interface java.lang.AutoCloseable
AiliaFeatureExtractor.Destroy(long)
public void compute(float[] dst, byte[] src, int srcStride, int srcWidth, int srcHeight, AiliaImageFormat srcFormat) throws AiliaException
dst
- The feature datasrc
- Image data (32 bpp)srcStride
- The number of bytes in 1 linesrcWidth
- Image widthsrcHeight
- Image heightsrcFormat
- Image format (AiliaImageFormat
)AiliaException
- ExceptionAiliaFeatureExtractor.Compute(long, float[], int, byte[], int, int, int, int)
public float match(AiliaFeatureExtractorDistanceType distanceType, float[] feature1, float[] feature2) throws AiliaException
distanceType
- The type of the distance in feature space AiliaFeatureExtractorDistanceType
feature1
- The featurefeature2
- The other featureAiliaException
- ExceptionAiliaFeatureExtractor.Match(long, int, float[], int, float[], int)
@Deprecated public float match(int distanceType, float[] feature1, float[] feature2) throws AiliaException
AiliaException