Skip to content

Commit f9e6f7a

Browse files
committed
fix: data directory didn't exist
1 parent d4a58d0 commit f9e6f7a

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ RUN apt-get install cmake -y
1717

1818
WORKDIR /usr/src/app
1919
COPY requirements.txt ./
20+
RUN mkdir data
2021
RUN pip3 install -r requirements.txt
2122
COPY . .
2223

-12 Bytes
Binary file not shown.

accounts/collect_training_data.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
def generate_dataset(img, userID):
1818
""" "Function to save the reference frameage"""
19-
2019
# try block to write the image in the directory
2120
try:
2221
os.mkdir(os.path.join(settings.BASE_DIR, "data", userID))
@@ -26,11 +25,9 @@ def generate_dataset(img, userID):
2625
# try block to catch if encoded is extracted from the first image
2726
try:
2827
train_encoding = fr.face_encodings(img)[0]
29-
28+
3029
cv2.imwrite(
31-
os.path.join(
32-
settings.BASE_DIR, "data", userID, "train.jpg"
33-
),
30+
os.path.join(settings.BASE_DIR, "data", userID, "train.jpg"),
3431
img,
3532
)
3633
return True
@@ -39,7 +36,7 @@ def generate_dataset(img, userID):
3936

4037

4138
def draw_boundary(img):
42-
""" "function to get region of interest from the face"""
39+
"""function to get region of interest from the face"""
4340

4441
print(detect)
4542
height, width, _ = img.shape
@@ -110,7 +107,7 @@ def collectTrainingData(userID):
110107
if not success:
111108
video_capture.grab()
112109
break
113-
110+
114111
isImageOk = detect(img, userID)
115112
if isImageOk:
116113
resp = {"Success": True, "Message": "Face registered."}

db.sqlite3

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)