face_loadTrainingData1
import { face_loadTrainingData1 } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
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;imageListA file contains the list of image filenames in the training dataset.
groundTruthA 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).
imagesA vector where each element represent the filename of image in the dataset. Images are not loaded by default to save the memory.
facePointsOutput destination, filled by the native operation. The loaded landmark points for all training data.
offsetAn offset value to adjust the loaded points.
<B>Example of usage</B>
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.