Yolo
npm install capacitor-ultralytics-yolo
npx cap syncloadModel(...)detectObjects(...)classifyImage(...)segmentInstances(...)estimatePose(...)detectOrientedBoxes(...)startRealTimeDetection(...)stopRealTimeDetection()processFrame(...)getAvailableModels()setConfidenceThreshold(...)setIoUThreshold(...)- Interfaces
- Type Aliases
loadModel(options: LoadModelOptions) => Promise<LoadModelResult>Load a YOLO model from assets
| Param | Type | Description |
|---|---|---|
options |
LoadModelOptions |
- Model loading options |
Returns: Promise<LoadModelResult>
detectObjects(options: DetectionOptions) => Promise<DetectionResult>Perform object detection on an image
| Param | Type | Description |
|---|---|---|
options |
DetectionOptions |
- Detection options |
Returns: Promise<DetectionResult>
classifyImage(options: ClassificationOptions) => Promise<ClassificationResult>Classify an image
| Param | Type | Description |
|---|---|---|
options |
ClassificationOptions |
- Classification options |
Returns: Promise<ClassificationResult>
segmentInstances(options: SegmentationOptions) => Promise<SegmentationResult>Perform instance segmentation
| Param | Type | Description |
|---|---|---|
options |
SegmentationOptions |
- Segmentation options |
Returns: Promise<SegmentationResult>
estimatePose(options: PoseEstimationOptions) => Promise<PoseEstimationResult>Estimate pose in an image
| Param | Type | Description |
|---|---|---|
options |
PoseEstimationOptions |
- Pose estimation options |
Returns: Promise<PoseEstimationResult>
detectOrientedBoxes(options: OBBDetectionOptions) => Promise<OBBDetectionResult>Detect oriented bounding boxes
| Param | Type | Description |
|---|---|---|
options |
OBBDetectionOptions |
- OBB detection options |
Returns: Promise<OBBDetectionResult>
startRealTimeDetection(options: RealTimeDetectionOptions) => Promise<void>Start real-time detection from camera
| Param | Type | Description |
|---|---|---|
options |
RealTimeDetectionOptions |
- Real-time detection options |
stopRealTimeDetection() => Promise<void>Stop real-time detection
processFrame(options: { imageData: string; }) => Promise<DetectionResult>Process a single frame for real-time detection
| Param | Type | Description |
|---|---|---|
options |
{ imageData: string; } |
- Frame processing options |
Returns: Promise<DetectionResult>
getAvailableModels() => Promise<AvailableModelsResult>Get available models
Returns: Promise<AvailableModelsResult>
setConfidenceThreshold(options: ConfidenceThresholdOptions) => Promise<void>Set detection confidence threshold
| Param | Type | Description |
|---|---|---|
options |
ConfidenceThresholdOptions |
- Confidence threshold options |
setIoUThreshold(options: IoUThresholdOptions) => Promise<void>Set IoU threshold for NMS
| Param | Type | Description |
|---|---|---|
options |
IoUThresholdOptions |
- IoU threshold options |
| Prop | Type |
|---|---|
success |
boolean |
modelId |
string |
message |
string |
| Prop | Type |
|---|---|
modelPath |
string |
modelType |
ModelType |
useGPU |
boolean |
numThreads |
number |
| Prop | Type |
|---|---|
success |
boolean |
detections |
Detection[] |
inferenceTime |
number |
imageWidth |
number |
imageHeight |
number |
| Prop | Type |
|---|---|
box |
BoundingBox |
confidence |
number |
label |
string |
classId |
number |
| Prop | Type |
|---|---|
x |
number |
y |
number |
width |
number |
height |
number |
| Prop | Type |
|---|---|
imagePath |
string |
imageData |
string |
modelId |
string |
confidenceThreshold |
number |
iouThreshold |
number |
maxResults |
number |
| Prop | Type |
|---|---|
success |
boolean |
classifications |
Classification[] |
inferenceTime |
number |
| Prop | Type |
|---|---|
label |
string |
confidence |
number |
classId |
number |
| Prop | Type |
|---|---|
imagePath |
string |
imageData |
string |
modelId |
string |
topK |
number |
| Prop | Type |
|---|---|
success |
boolean |
segments |
Segment[] |
inferenceTime |
number |
imageWidth |
number |
imageHeight |
number |
| Prop | Type |
|---|---|
box |
BoundingBox |
confidence |
number |
label |
string |
classId |
number |
mask |
number[][] |
| Prop | Type |
|---|---|
imagePath |
string |
imageData |
string |
modelId |
string |
confidenceThreshold |
number |
iouThreshold |
number |
| Prop | Type |
|---|---|
success |
boolean |
poses |
Pose[] |
inferenceTime |
number |
imageWidth |
number |
imageHeight |
number |
| Prop | Type |
|---|---|
box |
BoundingBox |
confidence |
number |
keypoints |
Keypoint[] |
| Prop | Type |
|---|---|
x |
number |
y |
number |
confidence |
number |
name |
string |
| Prop | Type |
|---|---|
imagePath |
string |
imageData |
string |
modelId |
string |
confidenceThreshold |
number |
| Prop | Type |
|---|---|
success |
boolean |
detections |
OBBDetection[] |
inferenceTime |
number |
imageWidth |
number |
imageHeight |
number |
| Prop | Type |
|---|---|
box |
OrientedBoundingBox |
confidence |
number |
label |
string |
classId |
number |
| Prop | Type |
|---|---|
centerX |
number |
centerY |
number |
width |
number |
height |
number |
angle |
number |
| Prop | Type |
|---|---|
imagePath |
string |
imageData |
string |
modelId |
string |
confidenceThreshold |
number |
iouThreshold |
number |
| Prop | Type |
|---|---|
modelId |
string |
confidenceThreshold |
number |
iouThreshold |
number |
frameSkip |
number |
| Prop | Type |
|---|---|
models |
ModelInfo[] |
| Prop | Type |
|---|---|
id |
string |
name |
string |
type |
ModelType |
path |
string |
isLoaded |
boolean |
| Prop | Type |
|---|---|
modelId |
string |
threshold |
number |
| Prop | Type |
|---|---|
modelId |
string |
threshold |
number |
'detection' | 'classification' | 'segmentation' | 'pose' | 'obb'