public class AiliaDetectorModel
extends java.lang.Object
implements java.lang.AutoCloseable
Constructor and Description |
---|
AiliaDetectorModel(long netHandle,
AiliaNetworkImageFormat format,
AiliaNetworkImageChannel channel,
AiliaNetworkImageRange range,
AiliaDetectorAlgorithm algorithm,
int categoryCount,
java.util.EnumSet<AiliaDetectorFlags> flags)
Constructor
|
AiliaDetectorModel(long netHandle,
AiliaNetworkImageFormat format,
AiliaNetworkImageChannel channel,
AiliaNetworkImageRange range,
int algorithm,
int categoryCount,
int flags)
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Destroys the detector instance.
|
void |
compute(byte[] src,
int srcStride,
int srcWidth,
int srcHeight,
AiliaImageFormat srcFormat,
float threshold,
float iou)
Performs object detection.
|
AiliaDetectorObject |
getObject(int index)
Gets the detection results.
|
int |
getObjectCount()
Gets the number of detection results.
|
void |
setAnchors(float[] anchors)
Sets the anchor information (anchors or biases) for YoloV2 or other systems.
|
public AiliaDetectorModel(long netHandle, AiliaNetworkImageFormat format, AiliaNetworkImageChannel channel, AiliaNetworkImageRange range, AiliaDetectorAlgorithm algorithm, int categoryCount, java.util.EnumSet<AiliaDetectorFlags> flags) throws AiliaException
netHandle
- A network instance handleformat
- The network image format (AiliaNetworkImageFormat
)channel
- The network image channel (AiliaNetworkImageChannel
)range
- The network image range (AiliaNetworkImageRange
)algorithm
- AiliaDetectorAlgorithm
categoryCount
- The number of detection categories (specify 20 for VOC or 80 for COCO, etc.)flags
- AiliaDetectorFlags
AiliaException
- ExceptionAiliaDetector.Create(long, int, int, int, int, int, int)
@Deprecated public AiliaDetectorModel(long netHandle, AiliaNetworkImageFormat format, AiliaNetworkImageChannel channel, AiliaNetworkImageRange range, int algorithm, int categoryCount, int flags) throws AiliaException
AiliaDetectorModel(long, AiliaNetworkImageFormat, AiliaNetworkImageChannel, AiliaNetworkImageRange, AiliaDetectorAlgorithm, int, EnumSet)
AiliaException
public void close()
close
in interface java.lang.AutoCloseable
AiliaDetector.Destroy(long)
public void compute(byte[] src, int srcStride, int srcWidth, int srcHeight, AiliaImageFormat srcFormat, float threshold, float iou) throws AiliaException
src
- Image data (32 bpp)srcStride
- The number of bytes in 1 linesrcWidth
- Image widthsrcHeight
- Image heightsrcFormat
- Image format (AiliaImageFormat
)threshold
- The detection threshold (for example, 0.1f) (The smaller it is, the easier the detection will be and the more detected objects found.)iou
- Iou threshold (for example, 0.45f) (The smaller it is, the fewer detected objects found, as duplication is not allowed.)AiliaException
- ExceptionAiliaDetector.Compute(long, byte[], int, int, int, int, float, float)
public int getObjectCount() throws AiliaException
AiliaException
- ExceptionAiliaDetector.GetObjectCount(long)
public AiliaDetectorObject getObject(int index) throws AiliaException
index
- Object indexAiliaException
- ExceptionAiliaDetector.GetObject(long, int, int)
public void setAnchors(float[] anchors) throws AiliaException
anchors
- The anchor dimensions (the shape, height and width of the detection box)AiliaException
- ExceptionAiliaDetector.SetAnchors(long, float[], int)