Skip to content

Commit

Permalink
Code fix
Browse files Browse the repository at this point in the history
  • Loading branch information
WisamAbbasi committed Sep 8, 2023
1 parent a6429db commit cfadd40
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def loaded_model():
)

model = get_model(cfg)
return model
return model, detector, img_size, weight_file


@app.route(
Expand All @@ -101,7 +101,7 @@ def cam_object_recognition(

frame_id = 0

model = loaded_model()
model, detector, img_size, weight_file = loaded_model()
model.load_weights(weight_file)
predicted_ages3 = []

Expand Down Expand Up @@ -262,7 +262,7 @@ def handler(
cap = cv2.VideoCapture(video_link)
frame_id = 0

model = loaded_model()
model, detector, img_size, weight_file = loaded_model()
model.load_weights(weight_file)
predicted_ages3 = []

Expand Down Expand Up @@ -296,6 +296,8 @@ def handler(
detected = detector(input_img, 1)
faces = np.empty((len(detected), img_size, img_size, 3))

predicted_ages2 = []

if len(detected) > 0:
for i, d in enumerate(detected):
x1, y1, x2, y2, w, h = (
Expand Down

0 comments on commit cfadd40

Please sign in to comment.