Ajout cercle progress

This commit is contained in:
telereview
2023-03-28 12:18:36 +02:00
parent ef2c3cdce4
commit 269402775d
6 changed files with 29 additions and 15 deletions

View File

@@ -103,8 +103,14 @@ class HandDetector():
else:
result = False
progress = 0
if thumbState == "thumbs_up":
progress = thumbsUpCount / (self.BUFFER_LENGTH * self.DETECTION_THRESHOLD)
elif thumbState == "thumbs_down":
progress = thumbsDownCount / (self.BUFFER_LENGTH * self.DETECTION_THRESHOLD)
if(thumbState != "neutre"):
return thumbState, handLandmarks[9], np.linalg.norm(np.array(handLandmarks[9]) - np.array(handLandmarks[0])), result
return thumbState, handLandmarks[9], np.linalg.norm(np.array(handLandmarks[9]) - np.array(handLandmarks[0])), result, progress
return False

View File

@@ -54,8 +54,8 @@ class Manager():
res = self.handDetector.detect()
if(res != False):
state, coords, size, finalDecision = res
self.server.sendMessage({"type": "effects", "effects": [{"type": state, "x":coords[0], "y": coords[1], "width": size, "height": size}]})
state, coords, size, finalDecision, progress = res
self.server.sendMessage({"type": "effects", "effects": [{"type": "loading", "x":coords[0], "y": coords[1], "width": size, "height": size, "progress": progress},{"type": state, "x":coords[0], "y": coords[1], "width": size, "height": size}]})
self.isLastHandPacketEmpty = False
self.timeLastChange = time.time()
if(finalDecision != False):

View File

@@ -5,4 +5,5 @@ mediapipe
numpy
pyaudio
librosa
scipy
scipy
python-dotenv

View File

@@ -1,9 +0,0 @@
[Unit]
Description=Téléreview scripts
[Service]
Type=oneshot
ExecStart=/home/telereview/pact71/code/setup.sh
[Install]
WantedBy=multi-user.target