Running HAMS Face Verification module#
[ ]:
import os
from ipywidgets import FileUpload
from omegaconf import OmegaConf
from mapping_cli.maneuvers.face_verification import FaceVerification
from mapping_cli.config.config import Config
[ ]:
from ipywidgets import FileUpload
from IPython.display import display, Image
upload = FileUpload(accept='.mp4', multiple=False)
display(upload)
Upload the calibration video to registered the driver taking the test
[ ]:
with open("calibration.mp4", "wb") as f:
f.write(upload.value[0].content)
Upload the video of the driver-facing camera to check if it’s the registered driver that is taking the test
[ ]:
with open("front_video.mp4", "wb") as f:
f.write(upload.value[0].content)
Modify the config variables depending on the need.
[ ]:
config = {
}
Now, save the config to face_verification.yaml
, create a directory to store the outputs named output
and run the seabelt module
[ ]:
with open('face_verification.yaml', 'w') as f:
OmegaConf.save(OmegaConf.create(config), f)
os.makedirs('output', exist_ok=True)
[ ]:
face_verification = FaceVerification(inputs={"fpath": os.path.abspath('front_video.mp4'), "calib_video": os.path.abspath('calibration.mp4')}, config=Config('face_verification.yaml'), out_folder='output')
_, result, _ = face_verification.run()
Final Test Results#
[ ]:
print(f"Same Driver: {result}")