mirror of
https://git.roussel.pro/telecom-paris/pact.git
synced 2026-02-09 02:20:17 +01:00
Ajout cercle progress
This commit is contained in:
@@ -103,8 +103,14 @@ class HandDetector():
|
|||||||
else:
|
else:
|
||||||
result = False
|
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"):
|
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
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ class Manager():
|
|||||||
|
|
||||||
res = self.handDetector.detect()
|
res = self.handDetector.detect()
|
||||||
if(res != False):
|
if(res != False):
|
||||||
state, coords, size, finalDecision = res
|
state, coords, size, finalDecision, progress = res
|
||||||
self.server.sendMessage({"type": "effects", "effects": [{"type": state, "x":coords[0], "y": coords[1], "width": size, "height": size}]})
|
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.isLastHandPacketEmpty = False
|
||||||
self.timeLastChange = time.time()
|
self.timeLastChange = time.time()
|
||||||
if(finalDecision != False):
|
if(finalDecision != False):
|
||||||
|
|||||||
@@ -5,4 +5,5 @@ mediapipe
|
|||||||
numpy
|
numpy
|
||||||
pyaudio
|
pyaudio
|
||||||
librosa
|
librosa
|
||||||
scipy
|
scipy
|
||||||
|
python-dotenv
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -127,7 +127,7 @@ class CameraPage {
|
|||||||
this.ctx.strokeStyle = this.spinnerColor;
|
this.ctx.strokeStyle = this.spinnerColor;
|
||||||
|
|
||||||
this.ctx.beginPath();
|
this.ctx.beginPath();
|
||||||
this.ctx.arc(x, y, radius, 0, progress * 2 * Math.PI);
|
this.ctx.arc(x + radius / 2, y + radius / 2, radius, 0, progress * 2 * Math.PI);
|
||||||
this.ctx.stroke();
|
this.ctx.stroke();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,4 +150,4 @@ class CameraPage {
|
|||||||
reset() {
|
reset() {
|
||||||
this.activeEffects = [];
|
this.activeEffects = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,18 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
sudo modprobe v4l2loopback devices=2
|
sudo modprobe v4l2loopback devices=2
|
||||||
|
docker compose up -d
|
||||||
|
cd backend_reconnaissance
|
||||||
|
nohup python3 main.py &
|
||||||
|
sleep 10
|
||||||
|
export DISPLAY=:0
|
||||||
|
firefox http://localhost:8888 -kiosk
|
||||||
|
sleep 10
|
||||||
|
xdotool mousemove 389 169
|
||||||
|
sleep 0.1
|
||||||
|
xdotool click 1
|
||||||
|
xdotool mousemove 411 256
|
||||||
|
sleep 0.1
|
||||||
|
xdotool click 1
|
||||||
|
xdotool mousemove 614 256
|
||||||
|
sleep 0.1
|
||||||
|
xdotool click 1
|
||||||
|
|||||||
Reference in New Issue
Block a user