-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: run inference directly from raw_image #9
Comments
Hi @hoangtnm Thank you for your interest in 3DiVi Face SDK. You can use your own detector to create a sample by doing the following:
Please let me know if this works for you. |
I think def detect(img_path):
img = cv2.imread(img_path)
assert img is not None
raw_img = CVRawImage(img)
detected = capturer.manual_capture(raw_img)
print(f"On image detected {len(detected)} faces")
return detected
samples = detect(os.path.join(face_sdk_dir, "bin/set1", "01100.jpg"))
for i, sample in enumerate(samples):
age_gender_res = age_gender_estimator.estimate_age_gender(sample)
print(age_gender_res) but it raises
|
Hi @hoangtnm
|
Hi @leonid-leshukov, I don't have eye positions in your detector output. Actually, I only have face-bounding boxes from the detector. Therefore, I only want to create a |
Hi @hoangtnm To use fda_fake_detector_signleface examplefrom face_sdk_3divi import FacerecService, Config
from face_sdk_3divi.modules.raw_image import Format
from face_sdk_3divi.example import CVRawImage
import os
import cv2
import numpy as np
def detect(img_path):
img = cv2.imread(img_path)
assert img is not None
raw_img = CVRawImage(img)
detected = capturer.capture(raw_img)
print(f'On image detected {len(detected)} faces')
return detected
face_sdk_dir = "../.."
service = FacerecService.create_service(
os.path.join(face_sdk_dir, "bin/facerec.dll"),
os.path.join(face_sdk_dir, "conf/facerec"))
print('Service created')
config = Config("fda_fake_detector_singleface.xml")
config.override_parameter("fake_rect_center_x0", 0.628)
config.override_parameter("fake_rect_center_y0", 0.354)
config.override_parameter("fake_rect_size0", 0.1)
capturer = service.create_capturer(config)
print('Capturer created')
samples = detect(os.path.join(face_sdk_dir, "bin/1/8.jpg"))
for i, sample in enumerate(samples):
raw_img = sample.cut_face_raw_image(Format.FORMAT_GRAY) |
Hi, as I understand from the face_mask_and_eyes_closeness example, it requires input for
masked_face_estimator.estimate
to be detected faces from thecapturer
. However, there are several cases where I want to use my own face detection models and use the SDK'smasked_face_estimator
only. For this scenario, is there any way to bypass thecapturer.capture(raw_img)
and pass theraw_img = CVRawImage(img)
into the estimator?The text was updated successfully, but these errors were encountered: