Spaces:
Sleeping
Sleeping
jatin-tec commited on
Commit ·
31a1daf
1
Parent(s): 72796d5
final
Browse files
index.py
CHANGED
|
@@ -21,17 +21,19 @@ def predict(image):
|
|
| 21 |
dimension_dict = dict()
|
| 22 |
face_dict = dict()
|
| 23 |
image_dim = []
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
|
| 33 |
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
| 34 |
-
|
|
|
|
|
|
|
| 35 |
|
| 36 |
dim, face, img = extract_patches(image)
|
| 37 |
|
|
|
|
| 21 |
dimension_dict = dict()
|
| 22 |
face_dict = dict()
|
| 23 |
image_dim = []
|
| 24 |
+
try:
|
| 25 |
+
dim, face, img = get_patches.extract_patches(
|
| 26 |
+
image, dimension_dict, face_dict, image_dim, patch_path)
|
| 27 |
+
print("extract patches pass")
|
| 28 |
+
return dim, face, img
|
| 29 |
+
except:
|
| 30 |
+
print("extract patches fail")
|
| 31 |
+
return None, None, None
|
| 32 |
|
| 33 |
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
| 34 |
+
|
| 35 |
+
if not os.path.exists(os.path.join(BASE_DIR, 'patches')):
|
| 36 |
+
os.mkdir(os.path.join(BASE_DIR, 'patches'))
|
| 37 |
|
| 38 |
dim, face, img = extract_patches(image)
|
| 39 |
|