Spaces:
Runtime error
Runtime error
Shafeek Saleem
commited on
Commit
·
25ca690
1
Parent(s):
7638389
bug fixed images
Browse files
pages/3_Face Encodings.py
CHANGED
|
@@ -17,11 +17,16 @@ initialize_level()
|
|
| 17 |
LEVEL = 3
|
| 18 |
|
| 19 |
PKL_PATH = 'dataset/database.pkl'
|
| 20 |
-
information = defaultdict(dict)
|
| 21 |
|
| 22 |
def get_database():
|
| 23 |
-
|
| 24 |
-
database =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
return database
|
| 26 |
|
| 27 |
def step3_page():
|
|
|
|
| 17 |
LEVEL = 3
|
| 18 |
|
| 19 |
PKL_PATH = 'dataset/database.pkl'
|
|
|
|
| 20 |
|
| 21 |
def get_database():
|
| 22 |
+
if not os.path.exists(PKL_PATH):
|
| 23 |
+
database = {'hello': 'world'}
|
| 24 |
+
|
| 25 |
+
with open(PKL_PATH, 'wb') as f:
|
| 26 |
+
pickle.dump(database, f, protocol=pickle.HIGHEST_PROTOCOL)
|
| 27 |
+
else:
|
| 28 |
+
with open(PKL_PATH,'rb') as f:
|
| 29 |
+
database = pkl.load(f)
|
| 30 |
return database
|
| 31 |
|
| 32 |
def step3_page():
|