Skip to content

face_loadTrainingData1

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

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

ARGUMENTSimageList, groundTruth, images, facePoints
FUNCTIONface_loadTrainingData1
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 information from the dataset.

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

example of content in the images_train.txt

/home/user/ibug/image_003_1.jpg
/home/user/ibug/image_004_1.jpg
/home/user/ibug/image_005_1.jpg
/home/user/ibug/image_006.jpg

example of content in the points_train.txt

/home/user/ibug/image_003_1.pts
/home/user/ibug/image_004_1.pts
/home/user/ibug/image_005_1.pts
/home/user/ibug/image_006.pts
face_loadTrainingData1(imageList: EmbindString, groundTruth: EmbindString, images: StringVector, facePoints: Mat, offset: number): boolean;
2 available overloads
face_loadTrainingData1(imageList: EmbindString, groundTruth: EmbindString, images: StringVector, facePoints: Mat): boolean;
face_loadTrainingData1(imageList: EmbindString, groundTruth: EmbindString, images: StringVector, facePoints: Mat, offset: number): boolean;
imageList

A file contains the list of image filenames in the training dataset.

groundTruth

A file contains the list of filenames where the landmarks points information are stored. The content in each file should follow the standard format (see face::loadFacePoints).

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.

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.