Skip to content

dotnetdreamer/capacitor-ultralytics-yolo

Repository files navigation

capacitor-ultralytics-yolo

Yolo

Install

npm install capacitor-ultralytics-yolo
npx cap sync

API

loadModel(...)

loadModel(options: LoadModelOptions) => Promise<LoadModelResult>

Load a YOLO model from assets

Param Type Description
options LoadModelOptions - Model loading options

Returns: Promise<LoadModelResult>


detectObjects(...)

detectObjects(options: DetectionOptions) => Promise<DetectionResult>

Perform object detection on an image

Param Type Description
options DetectionOptions - Detection options

Returns: Promise<DetectionResult>


classifyImage(...)

classifyImage(options: ClassificationOptions) => Promise<ClassificationResult>

Classify an image

Param Type Description
options ClassificationOptions - Classification options

Returns: Promise<ClassificationResult>


segmentInstances(...)

segmentInstances(options: SegmentationOptions) => Promise<SegmentationResult>

Perform instance segmentation

Param Type Description
options SegmentationOptions - Segmentation options

Returns: Promise<SegmentationResult>


estimatePose(...)

estimatePose(options: PoseEstimationOptions) => Promise<PoseEstimationResult>

Estimate pose in an image

Param Type Description
options PoseEstimationOptions - Pose estimation options

Returns: Promise<PoseEstimationResult>


detectOrientedBoxes(...)

detectOrientedBoxes(options: OBBDetectionOptions) => Promise<OBBDetectionResult>

Detect oriented bounding boxes

Param Type Description
options OBBDetectionOptions - OBB detection options

Returns: Promise<OBBDetectionResult>


startRealTimeDetection(...)

startRealTimeDetection(options: RealTimeDetectionOptions) => Promise<void>

Start real-time detection from camera

Param Type Description
options RealTimeDetectionOptions - Real-time detection options

stopRealTimeDetection()

stopRealTimeDetection() => Promise<void>

Stop real-time detection


processFrame(...)

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()

getAvailableModels() => Promise<AvailableModelsResult>

Get available models

Returns: Promise<AvailableModelsResult>


setConfidenceThreshold(...)

setConfidenceThreshold(options: ConfidenceThresholdOptions) => Promise<void>

Set detection confidence threshold

Param Type Description
options ConfidenceThresholdOptions - Confidence threshold options

setIoUThreshold(...)

setIoUThreshold(options: IoUThresholdOptions) => Promise<void>

Set IoU threshold for NMS

Param Type Description
options IoUThresholdOptions - IoU threshold options

Interfaces

LoadModelResult

Prop Type
success boolean
modelId string
message string

LoadModelOptions

Prop Type
modelPath string
modelType ModelType
useGPU boolean
numThreads number

DetectionResult

Prop Type
success boolean
detections Detection[]
inferenceTime number
imageWidth number
imageHeight number

Detection

Prop Type
box BoundingBox
confidence number
label string
classId number

BoundingBox

Prop Type
x number
y number
width number
height number

DetectionOptions

Prop Type
imagePath string
imageData string
modelId string
confidenceThreshold number
iouThreshold number
maxResults number

ClassificationResult

Prop Type
success boolean
classifications Classification[]
inferenceTime number

Classification

Prop Type
label string
confidence number
classId number

ClassificationOptions

Prop Type
imagePath string
imageData string
modelId string
topK number

SegmentationResult

Prop Type
success boolean
segments Segment[]
inferenceTime number
imageWidth number
imageHeight number

Segment

Prop Type
box BoundingBox
confidence number
label string
classId number
mask number[][]

SegmentationOptions

Prop Type
imagePath string
imageData string
modelId string
confidenceThreshold number
iouThreshold number

PoseEstimationResult

Prop Type
success boolean
poses Pose[]
inferenceTime number
imageWidth number
imageHeight number

Pose

Prop Type
box BoundingBox
confidence number
keypoints Keypoint[]

Keypoint

Prop Type
x number
y number
confidence number
name string

PoseEstimationOptions

Prop Type
imagePath string
imageData string
modelId string
confidenceThreshold number

OBBDetectionResult

Prop Type
success boolean
detections OBBDetection[]
inferenceTime number
imageWidth number
imageHeight number

OBBDetection

Prop Type
box OrientedBoundingBox
confidence number
label string
classId number

OrientedBoundingBox

Prop Type
centerX number
centerY number
width number
height number
angle number

OBBDetectionOptions

Prop Type
imagePath string
imageData string
modelId string
confidenceThreshold number
iouThreshold number

RealTimeDetectionOptions

Prop Type
modelId string
confidenceThreshold number
iouThreshold number
frameSkip number

AvailableModelsResult

Prop Type
models ModelInfo[]

ModelInfo

Prop Type
id string
name string
type ModelType
path string
isLoaded boolean

ConfidenceThresholdOptions

Prop Type
modelId string
threshold number

IoUThresholdOptions

Prop Type
modelId string
threshold number

Type Aliases

ModelType

'detection' | 'classification' | 'segmentation' | 'pose' | 'obb'

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published