capacitor-ultralytics-yolo
Yolo
npm install capacitor-ultralytics-yolo
npx cap sync
loadModel ( options : LoadModelOptions ) = > Promise < LoadModelResult >
Load a YOLO model from assets
Returns: Promise<LoadModelResult >
detectObjects ( options : DetectionOptions ) = > Promise < DetectionResult >
Perform object detection on an image
Returns: Promise<DetectionResult >
classifyImage ( options : ClassificationOptions ) = > Promise < ClassificationResult >
Classify an image
Returns: Promise<ClassificationResult >
segmentInstances ( options : SegmentationOptions ) = > Promise < SegmentationResult >
Perform instance segmentation
Returns: Promise<SegmentationResult >
estimatePose ( options : PoseEstimationOptions ) = > Promise < PoseEstimationResult >
Estimate pose in an image
Returns: Promise<PoseEstimationResult >
detectOrientedBoxes ( options : OBBDetectionOptions ) = > Promise < OBBDetectionResult >
Detect oriented bounding boxes
Returns: Promise<OBBDetectionResult >
startRealTimeDetection(...)
startRealTimeDetection ( options : RealTimeDetectionOptions ) = > Promise < void >
Start real-time detection from camera
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(...)
setConfidenceThreshold ( options : ConfidenceThresholdOptions ) = > Promise < void >
Set detection confidence threshold
setIoUThreshold ( options : IoUThresholdOptions ) = > Promise < void >
Set IoU threshold for NMS
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
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
ConfidenceThresholdOptions
Prop
Type
modelId
string
threshold
number
Prop
Type
modelId
string
threshold
number
'detection' | 'classification' | 'segmentation' | 'pose' | 'obb'