Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/docs/guides/FRAME_PROCESSORS_CREATE_OVERVIEW.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Frame Processors can also accept parameters, following the same type convention
```ts
const frameProcessor = useFrameProcessor((frame) => {
'worklet'
const faces = scanFaces(frame, { accuracy: 'fast' })
const faces = detectFaces(frame, { accuracy: 'fast' })
}, [])
```

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guides/FRAME_PROCESSORS_INTERACTING.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const onFaceDetected = Worklets.createRunOnJS((face: Face) => {

const frameProcessor = useFrameProcessor((frame) => {
'worklet'
const faces = scanFaces(frame)
const faces = detectFaces(frame)
if (faces.length > 0) {
onFaceDetected(faces[0])
}
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/guides/FRAME_PROCESSOR_CREATE_FINAL.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ To make the Frame Processor Plugin available to the Frame Processor Worklet Runt
```ts
import { VisionCameraProxy, Frame } from 'react-native-vision-camera'

const plugin = VisionCameraProxy.initFrameProcessorPlugin('scanFaces')
const plugin = VisionCameraProxy.initFrameProcessorPlugin('detectFaces')

/**
* Scans faces.
*/
export function scanFaces(frame: Frame): object {
export function detectFaces(frame: Frame): object {
'worklet'
if (plugin == null) throw new Error('Failed to load Frame Processor Plugin "scanFaces"!')
if (plugin == null) throw new Error('Failed to load Frame Processor Plugin "detectFaces"!')
return plugin.call(frame)
}
```
Expand All @@ -32,7 +32,7 @@ function App() {
const frameProcessor = useFrameProcessor((frame) => {
'worklet'
// highlight-next-line
const faces = scanFaces(frame)
const faces = detectFaces(frame)
console.log(`Faces in Frame: ${faces}`)
}, [])

Expand Down
4 changes: 2 additions & 2 deletions package/src/frame-processors/VisionCameraProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ interface TVisionCameraProxy {
* @param options (optional) Options, as a native dictionary, passed to the constructor/init-function of the native plugin.
* @example
* ```ts
* const plugin = VisionCameraProxy.initFrameProcessorPlugin('scanFaces', { model: 'fast' })
* if (plugin == null) throw new Error("Failed to load scanFaces plugin!")
* const plugin = VisionCameraProxy.initFrameProcessorPlugin('detectFaces', { model: 'fast' })
* if (plugin == null) throw new Error("Failed to load detectFaces plugin!")
* ```
*/
initFrameProcessorPlugin(name: string, options: Record<string, ParameterType>): FrameProcessorPlugin | undefined
Expand Down
2 changes: 1 addition & 1 deletion package/src/hooks/useFrameProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function createFrameProcessor(frameProcessor: (frame: Frame) => void): Re
* ```ts
* const frameProcessor = useFrameProcessor((frame) => {
* 'worklet'
* const faces = scanFaces(frame)
* const faces = detectFaces(frame)
* console.log(`Faces: ${faces}`)
* }, [])
* ```
Expand Down
4 changes: 2 additions & 2 deletions package/src/skia/useSkiaFrameProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ function getSurfaceSize(frame: Frame): Size {
* const offscreenTextures = Worklets.createSharedValue<SkImage[]>([])
* const frameProcessor = createSkiaFrameProcessor((frame) => {
* 'worklet'
* const faces = scanFaces(frame)
* const faces = detectFaces(frame)
*
* frame.render()
* for (const face of faces) {
Expand Down Expand Up @@ -317,7 +317,7 @@ export function createSkiaFrameProcessor(
* ```ts
* const frameProcessor = useSkiaFrameProcessor((frame) => {
* 'worklet'
* const faces = scanFaces(frame)
* const faces = detectFaces(frame)
*
* frame.render()
* for (const face of faces) {
Expand Down
2 changes: 1 addition & 1 deletion package/src/types/CameraProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ export interface CameraProps extends ViewProps {
* ```tsx
* const frameProcessor = useFrameProcessor((frame) => {
* 'worklet'
* const faces = scanFaces(frame)
* const faces = detectFaces(frame)
* console.log(`Faces: ${faces}`)
* }, [])
*
Expand Down