Skip to content

Commit

Permalink
made changes to annoying windows usage of backslashes and pushed pipf…
Browse files Browse the repository at this point in the history
…iles
  • Loading branch information
aaj2005 committed Feb 25, 2024
1 parent 4518e44 commit fb787d0
Show file tree
Hide file tree
Showing 3 changed files with 582 additions and 6 deletions.
8 changes: 4 additions & 4 deletions AI/SpeedTesting.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@


# load json and create model
json_file = open("AI\model\emotion_model.json", 'r')
json_file = open("AI/model/emotion_model.json", 'r')
loaded_model_json = json_file.read()
json_file.close()
emotion_model = model_from_json(loaded_model_json)

# load weights into new model
emotion_model.load_weights("AI\model\emotion_model.h5")
emotion_model.load_weights("AI/model/emotion_model.h5")
print("Loaded model from disk")

def colourBasedEmotion(emotion):
colourDict = {0: (0, 0, 255), 1: (0, 255, 0), 2: (255, 0, 255), 3: (0, 255, 255), 4: (255,255,255), 5: (255, 0, 0), 6: (0, 165, 255)}
return colourDict[emotion]

def takeSinglePhoto(frame):
face_detector = cv2.CascadeClassifier('AI\haarcascade_frontalface_default.xml')
face_detector = cv2.CascadeClassifier('AI/haarcascade_frontalface_default.xml')
gray_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
num_faces = face_detector.detectMultiScale(gray_frame, scaleFactor=1.3, minNeighbors=5)
maxindex = -1
Expand Down Expand Up @@ -65,4 +65,4 @@ def mainLoop(frame):
# cap = cv2.VideoCapture(0)
# while True:
# ret, frame = cap.read()
# print(mainLoop(frame))
# print(mainLoop(frame))
2 changes: 2 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ pillow = "*"
numpy = "*"
opencv-python-headless = "*"
flask-cors = "*"
keras = "*"
tensorflow = "*"

[dev-packages]

Expand Down
Loading

0 comments on commit fb787d0

Please sign in to comment.