Spaces:
Runtime error
Runtime error
Download utils/database.py from aieye/face_recognition_tutorial: direct link, hf CLI and curl.
- Browser
- Download file 253 Bytes
-
https://huggingface.co/spaces/aieye/face_recognition_tutorial/resolve/main/utils/database.py
- Command line
-
hf download hf://spaces/aieye/face_recognition_tutorial/utils/database.py
-
curl -L -o database.py https://huggingface.co/spaces/aieye/face_recognition_tutorial/resolve/main/utils/database.py
253 Bytes
| import os | |
| import pickle | |
| def get_database(PKL_PATH): | |
| database = {} | |
| if os.path.getsize(PKL_PATH) > 0: | |
| with open(PKL_PATH, "rb") as f: | |
| unpickler = pickle.Unpickler(f) | |
| database = unpickler.load() | |
| return database |