Skip to content

face_loadTrainingData

facefunctionOpenCV 5.0.0
import { face_loadTrainingData } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSfilename, images, facePoints, delim
FUNCTIONface_loadTrainingData
RETURN TYPEboolean
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

A utility to load facial landmark dataset from a single file.

/home/user/ibug/image_003_1.jpg 336.820955 240.864510 334.238298 260.922709 335.266918 ...
/home/user/ibug/image_005_1.jpg 376.158428 230.845712 376.736984 254.924635 383.265403 ...
cv::String imageFiles = "../data/images_train.txt";
cv::String ptsFiles = "../data/points_train.txt";
std::vector<String> images;
std::vector<std::vector<Point2f> > facePoints;
loadTrainingData(imageFiles, ptsFiles, images, facePoints, 0.0f);
face_loadTrainingData(filename: EmbindString, images: StringVector, facePoints: Mat, delim: number, offset: number): boolean;
3 available overloads
face_loadTrainingData(filename: EmbindString, images: StringVector, facePoints: Mat): boolean;
face_loadTrainingData(filename: EmbindString, images: StringVector, facePoints: Mat, delim: number): boolean;
face_loadTrainingData(filename: EmbindString, images: StringVector, facePoints: Mat, delim: number, offset: number): boolean;
filename

The filename of a file that contains the dataset information. Each line contains the filename of an image followed by pairs of x and y values of facial landmarks points separated by a space. Example

images

A vector where each element represent the filename of image in the dataset. Images are not loaded by default to save the memory.

facePoints

Output destination, filled by the native operation. The loaded landmark points for all training data.

delim

Delimiter between each element, the default value is a whitespace.

offset

An offset value to adjust the loaded points.

<B>Example of usage</B>

Returns

The boolean result.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.