public class DetectorModel extends Object implements AutoCloseable
| 构造器和说明 |
|---|
DetectorModel() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
显式释放资源
|
DetectionResponse |
detect(BufferedImage image)
已过时。
|
DetectionResponse |
detect(byte[] imageData)
已过时。
|
DetectionResponse |
detect(ai.djl.modality.cv.Image image)
目标检测
|
DetectionResponse |
detect(String imagePath)
已过时。
|
BufferedImage |
detectAndDraw(BufferedImage sourceImage)
已过时。
|
DetectionResponse |
detectAndDraw(ai.djl.modality.cv.Image image)
检测并绘制
|
void |
detectAndDraw(String imagePath,
String outputPath)
目标检测-将检测结果绘制到原图
|
ai.djl.modality.cv.output.DetectedObjects |
detectCore(ai.djl.modality.cv.Image image)
目标检测
|
org.apache.commons.pool2.impl.GenericObjectPool<ai.djl.inference.Predictor<ai.djl.modality.cv.Image,ai.djl.modality.cv.output.DetectedObjects>> |
getPool() |
boolean |
isFromFactory() |
void |
loadModel(DetectorModelConfig config) |
void |
setFromFactory(boolean fromFactory) |
public void setFromFactory(boolean fromFactory)
public boolean isFromFactory()
public void loadModel(DetectorModelConfig config)
@Deprecated public DetectionResponse detect(String imagePath)
imagePath - Exceptionpublic void detectAndDraw(String imagePath, String outputPath)
imagePath - outputPath - @Deprecated public DetectionResponse detect(byte[] imageData)
imageData - @Deprecated public DetectionResponse detect(BufferedImage image)
image - @Deprecated public BufferedImage detectAndDraw(BufferedImage sourceImage)
sourceImage - public DetectionResponse detect(ai.djl.modality.cv.Image image)
image - public DetectionResponse detectAndDraw(ai.djl.modality.cv.Image image)
image - public ai.djl.modality.cv.output.DetectedObjects detectCore(ai.djl.modality.cv.Image image)
image - public org.apache.commons.pool2.impl.GenericObjectPool<ai.djl.inference.Predictor<ai.djl.modality.cv.Image,ai.djl.modality.cv.output.DetectedObjects>> getPool()
public void close()
close 在接口中 AutoCloseableCopyright © 2025. All rights reserved.