0
0
Fork 0
mirror of https://github.com/boltgolt/howdy.git synced 2024-09-12 09:41:18 +02:00

Merge branch 'beta' into meson

This commit is contained in:
boltgolt 2023-09-05 23:02:09 +02:00 committed by GitHub
commit 93a3d71a76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 4 deletions

View file

@ -4,6 +4,7 @@
import subprocess
import sys
import os
# Backup the config file if we're upgrading
if "upgrade" in sys.argv:

View file

@ -76,13 +76,16 @@ if not builtins.howdy_args.plain:
# Set the default label
label = "Initial model"
# some id's can be skipped, but the last id is always the maximum
next_id = encodings[-1]["id"] + 1 if encodings else 0
# Get the label from the cli arguments if provided
if builtins.howdy_args.arguments:
label = builtins.howdy_args.arguments[0]
# If models already exist, set that default label
elif encodings:
label = _("Model #") + str(len(encodings) + 1)
# Or set the default label
else:
label = _("Model #") + str(next_id)
# Keep de default name if we can't ask questions
if builtins.howdy_args.y:
@ -104,7 +107,7 @@ if "," in label:
insert_model = {
"time": int(time.time()),
"label": label,
"id": len(encodings),
"id": next_id,
"data": []
}

View file

@ -86,6 +86,12 @@ force_mjpeg = false
# OPENCV only.
exposure = -1
# Specify frame rate of the capture device.
# Some IR emitters will not function properly at the default framerate.
# Use qv4l2 to determine an appropriate value.
# OPENCV only.
device_fps = -1
# Rotate captured frames so faces are upright.
# 0 Check landscape orientation only
# 1 Check both landscape and portrait orientation

View file

@ -124,6 +124,12 @@ class VideoCapture:
self.config.get("video", "device_path"),
cv2.CAP_V4L
)
# Set the capture frame rate
# Without this the first detected (and possibly lower) frame rate is used, -1 seems to select the highest
# Use 0 as a fallback to avoid breaking an existing setup, new installs should default to -1
self.fps = self.config.getint("video", "device_fps", fallback=0)
if self.fps != 0:
self.internal.set(cv2.CAP_PROP_FPS, self.fps)
# Force MJPEG decoding if true
if self.config.getboolean("video", "force_mjpeg", fallback=False):