-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/v0.9.0' into 'main'
Release: v0.9.0 See merge request sertiscorp/mle/edge/oneml-bootcamp!39
- Loading branch information
Showing
44 changed files
with
416 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#include <iomanip> | ||
#include <numeric> | ||
|
||
#include "apps_config.h" | ||
#include "oneml/public/oneml.h" | ||
|
||
int main(int argc, char** argv) { | ||
#ifdef _WIN32 | ||
_putenv_s("ONEML_CPP_MIN_LOG_LEVEL", "ERROR"); | ||
#else | ||
setenv("ONEML_CPP_MIN_LOG_LEVEL", "ERROR", 1); | ||
#endif | ||
|
||
oneML::LicenseManager license_manager; | ||
license_manager.activate_trial(); | ||
|
||
oneML::Utils utils(license_manager); | ||
oneML::face::EKYC ekyc(license_manager); | ||
|
||
// Images | ||
oneML::Image img1; | ||
oneML::Image img2; | ||
const std::string path1(ASSETS_DIR_PATH "/face-detect-set/face/8.jpg"); | ||
const std::string path2(ASSETS_DIR_PATH "/face-detect-set/face/9.jpg"); | ||
utils.read_image_cv(path1, img1); | ||
utils.read_image_cv(path2, img2); | ||
|
||
// RUN | ||
oneML::face::EKYCResult output; | ||
oneML::face::EKYCOps ops{true, true}; | ||
ekyc.run(img1, img2, ops, ops, output); | ||
|
||
oneML::face::Pose pose1; | ||
oneML::face::Pose pose2; | ||
oneML::face::BBox bbox1; | ||
oneML::face::BBox bbox2; | ||
oneML::face::FaceLandmark5 landmarks1; | ||
oneML::face::FaceLandmark5 landmarks2; | ||
|
||
auto status = output.get_return_status(); | ||
std::cout << "Status: " << status << std::endl; | ||
std::cout << "Same: " << output.is_same_person() << std::endl; | ||
std::cout << "Distance: " << output.get_distance() << std::endl; | ||
|
||
output.get_bboxes(bbox1, bbox2); | ||
output.get_landmarks(landmarks1, landmarks2); | ||
output.get_face_poses(pose1, pose2); | ||
|
||
std::cout << "Face 1" << std::endl; | ||
std::cout << "BBox: " << bbox1 << std::endl; | ||
std::cout << "Pose: " << pose1 << std::endl; | ||
std::cout << "Landmarks: " << landmarks1 << std::endl; | ||
|
||
std::cout << "Face 2" << std::endl; | ||
std::cout << "BBox: " << bbox2 << std::endl; | ||
std::cout << "Pose: " << pose2 << std::endl; | ||
std::cout << "Landmarks: " << landmarks2 << std::endl; | ||
|
||
oneML::UsageReport report = ekyc.get_usage(); | ||
report.to_log(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#include <iomanip> | ||
|
||
#include "apps_config.h" | ||
#include "oneml/public/oneml.h" | ||
|
||
int main(int argc, char** argv) { | ||
#ifdef _WIN32 | ||
_putenv_s("ONEML_CPP_MIN_LOG_LEVEL", "ERROR"); | ||
#else | ||
setenv("ONEML_CPP_MIN_LOG_LEVEL", "ERROR", 1); | ||
#endif | ||
|
||
oneML::LicenseManager license_manager; | ||
license_manager.activate_trial(); | ||
|
||
oneML::Utils utils(license_manager); | ||
oneML::face::FacePad pad_rgb(oneML::face::PadType::Rgb, license_manager); | ||
oneML::face::FacePad pad_paper(oneML::face::PadType::Paper, license_manager); | ||
|
||
// PAD RGB | ||
// image | ||
oneML::Image img; | ||
std::string path(ASSETS_DIR_PATH "/pad-rgb-set/spoof/1.jpg"); | ||
utils.read_image_cv(path, img); | ||
|
||
// RUN | ||
oneML::face::FacePadResult output; | ||
pad_rgb.classify(img, output); | ||
|
||
std::cout << "status: " << output.get_return_status() << std::endl; | ||
std::cout << "Spoof probability: " << std::fixed << std::setprecision(6) | ||
<< output.get_spoof_prob() << std::endl; | ||
std::cout << "Spoof classification: " << output.is_spoof() << std::endl; | ||
|
||
oneML::UsageReport report = pad_rgb.get_usage(); | ||
report.to_log(); | ||
|
||
// PAD PAPER | ||
path = ASSETS_DIR_PATH "/pad-paper-set/spoof/1.jpg"; | ||
utils.read_image_cv(path, img); | ||
|
||
// RUN | ||
pad_paper.classify(img, output); | ||
|
||
std::cout << "status: " << output.get_return_status() << std::endl; | ||
std::cout << "Spoof probability: " << std::fixed << std::setprecision(6) | ||
<< output.get_spoof_prob() << std::endl; | ||
std::cout << "Spoof classification: " << output.is_spoof() << std::endl; | ||
|
||
report = pad_paper.get_usage(); | ||
report.to_log(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using OneML.Face; | ||
|
||
class FacePadApp { | ||
static void Main(string[] args) { | ||
LicenseManager manager = new LicenseManager(); | ||
manager.ActivateTrial(); | ||
|
||
FacePad pad_rgb = new FacePad(PadType.Rgb, manager); | ||
FacePad pad_paper = new FacePad(PadType.Paper, manager); | ||
Utils utils = new Utils(manager); | ||
|
||
// PAD RGB | ||
string basePath = @"../../../assets/images/"; | ||
string path = basePath + @"pad-rgb-set/spoof/1.jpg"; | ||
Image image = utils.ReadImageCV(path); | ||
FacePadResult result = pad_rgb.Classify(image); | ||
|
||
string precision = "F6"; | ||
Console.WriteLine("Status: " + result.GetReturnStatus()); | ||
Console.WriteLine("Spoof probability: " + result.GetSpoofProb().ToString(precision)); | ||
Console.WriteLine("Spoof classification: " + result.IsSpoof()); | ||
|
||
UsageReport report = pad_rgb.GetUsage(); | ||
report.ToLog(); | ||
|
||
// PAD PAPER | ||
path = basePath + @"pad-paper-set/spoof/1.jpg"; | ||
image = utils.ReadImageCV(path); | ||
result = pad_paper.Classify(image); | ||
|
||
Console.WriteLine("Status: " + result.GetReturnStatus()); | ||
Console.WriteLine("Spoof probability: " + result.GetSpoofProb().ToString(precision)); | ||
Console.WriteLine("Spoof classification: " + result.IsSpoof()); | ||
|
||
report = pad_paper.GetUsage(); | ||
report.ToLog(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.