Add AMD support via ort alternative to trt
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#include "gallery_builder.hpp"
|
||||
#include "arcface_embedder.hpp"
|
||||
#include "config.hpp"
|
||||
#include "face_utils.hpp"
|
||||
#include "ort_provider.hpp"
|
||||
#include "scrfd_decoder.hpp"
|
||||
#include "inference/face_detector.hpp"
|
||||
#include "inference/face_embedder.hpp"
|
||||
|
||||
#include <opencv2/imgcodecs.hpp>
|
||||
|
||||
@@ -31,11 +31,13 @@ static std::pair<std::string, std::string> parse_dir_name(const std::string& dir
|
||||
// ── Public API ────────────────────────────────────────────────────────────────
|
||||
|
||||
ActorGallery build_gallery(const BuildConfig& cfg) {
|
||||
const OrtProvider provider = detect_ort_provider();
|
||||
std::cerr << "[build_gallery] inference provider: " << provider_name(provider) << "\n";
|
||||
|
||||
SCRFDDecoder decoder(cfg.detector_model, cfg.detector_conf, cfg.detector_nms, provider);
|
||||
ArcFaceEmbedder arcface(cfg.arcface_model, provider);
|
||||
Config icfg;
|
||||
icfg.detector_model = cfg.detector_model;
|
||||
icfg.arcface_model = cfg.arcface_model;
|
||||
icfg.detector_conf = cfg.detector_conf;
|
||||
icfg.detector_nms = cfg.detector_nms;
|
||||
auto decoder = make_face_detector(icfg);
|
||||
auto arcface = make_face_embedder(icfg);
|
||||
|
||||
ActorGallery gallery;
|
||||
|
||||
@@ -70,7 +72,7 @@ ActorGallery build_gallery(const BuildConfig& cfg) {
|
||||
}
|
||||
}
|
||||
|
||||
auto faces = decoder.detect(img);
|
||||
auto faces = decoder->detect(img);
|
||||
|
||||
if (faces.empty()) {
|
||||
std::cerr << " [skip] no face: " << img_file.path().filename() << "\n";
|
||||
@@ -93,7 +95,7 @@ ActorGallery build_gallery(const BuildConfig& cfg) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Embedding emb = arcface.embed_one(crop);
|
||||
Embedding emb = arcface->embed_one(crop);
|
||||
actor.embeddings.push_back(emb);
|
||||
actor.source_images.push_back(img_file.path().filename().string());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user