Skip to content

Commit

Permalink
updated deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
tb-dhk committed Jul 2, 2024
1 parent 6a16fb3 commit d0f3abf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def get_weight():

def take_picture():
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
filename = f"/home/pi/foodpod/{timestamp}.jpg"
filename = f"/home/pi/food-pod/{timestamp}.jpg"
command = ["libcamera-still", "-o", filename, "--vflip", "-n"]
subprocess.run(command, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
log_message(f"Picture taken and saved as {filename}")
Expand Down Expand Up @@ -165,11 +165,11 @@ def monitor_weight():

if abs(current_weight - prev_weight) > 0.01: # Adjust the threshold as needed
new_pic = take_picture()
pics = get_latest_pictures("/home/pi/foodpod")
pics = get_latest_pictures("/home/pi/food-pod")
if len(pics) >= 2:
diff_image = find_differences(pics[0], pics[1])
cv2.imwrite("/home/pi/foodpod/diff.jpg", diff_image)
detect_food("/home/pi/foodpod/diff.jpg")
cv2.imwrite("/home/pi/food-pod/diff.jpg", diff_image)
detect_food("/home/pi/food-pod/diff.jpg")
else:
detect_food(new_pic)
prev_weight = current_weight
Expand Down

0 comments on commit d0f3abf

Please sign in to comment.