Commit 1cae081468ea82086517ae3d56e05251c1be93a6
1 parent
d7e2f8fc
janus tweaks
Showing
1 changed file
with
4 additions
and
7 deletions
openbr/janus.cpp
| ... | ... | @@ -18,16 +18,13 @@ janus_error janus_initialize(const char *sdk_path, const char *model_file) |
| 18 | 18 | const char *argv[1] = { "janus" }; |
| 19 | 19 | Context::initialize(argc, (char**)argv, sdk_path, false); |
| 20 | 20 | Globals->quiet = true; |
| 21 | - QString algorithm = model_file; | |
| 21 | + const QString algorithm = model_file; | |
| 22 | 22 | if (algorithm.isEmpty()) { |
| 23 | - transform = Transform::fromAlgorithm("Cvt(Gray)+Affine(88,88,0.25,0.35)+<FaceRecognitionExtraction>+<FaceRecognitionEmbedding>+<FaceRecognitionQuantization>", false); | |
| 23 | + transform.reset(Transform::make("Cvt(Gray)+Affine(88,88,0.25,0.35)+<FaceRecognitionExtraction>+<FaceRecognitionEmbedding>+<FaceRecognitionQuantization>", NULL)); | |
| 24 | 24 | distance = Distance::fromAlgorithm("FaceRecognition"); |
| 25 | - } else if (algorithm == "PP5") { | |
| 26 | - transform.reset(Transform::make("PP5Enroll", NULL)); | |
| 27 | - distance.reset(Distance::make("PP5Compare", NULL)); | |
| 28 | 25 | } else { |
| 29 | - transform = Transform::fromAlgorithm(algorithm, false); | |
| 30 | - distance = Distance::fromAlgorithm(algorithm); | |
| 26 | + transform.reset(Transform::make(algorithm + "Enroll", NULL)); | |
| 27 | + distance.reset(Distance::make(algorithm + "Compare", NULL)); | |
| 31 | 28 | } |
| 32 | 29 | return JANUS_SUCCESS; |
| 33 | 30 | } | ... | ... |