mirror of
https://github.com/EyeTrackVR/EyeTrackVR.git
synced 2025-11-04 14:39:42 +08:00
force push with python upgrade
This commit is contained in:
parent
43e86c2ae8
commit
45df46ac07
@ -1,5 +1,3 @@
|
||||
import time
|
||||
|
||||
import PySimpleGUI as sg
|
||||
from config import EyeTrackConfig
|
||||
from config import EyeTrackSettingsConfig
|
||||
@ -11,12 +9,9 @@ from queue import Queue, Empty
|
||||
from camera import Camera, CameraState
|
||||
from osc import EyeId
|
||||
import cv2
|
||||
import sys
|
||||
from utils.misc_utils import PlaySound, SND_FILENAME, SND_ASYNC, resource_path
|
||||
import traceback
|
||||
import numpy as np
|
||||
|
||||
|
||||
class CameraWidget:
|
||||
def __init__(self, widget_id: EyeId, main_config: EyeTrackConfig, osc_queue: Queue):
|
||||
self.gui_camera_addr = f"-CAMERAADDR{widget_id}-"
|
||||
@ -47,7 +42,6 @@ class CameraWidget:
|
||||
self.configl = main_config.left_eye
|
||||
self.configr = main_config.right_eye
|
||||
self.settings = main_config.settings
|
||||
self.update_wait_count = 100
|
||||
if self.eye_id == EyeId.RIGHT:
|
||||
self.config = main_config.right_eye
|
||||
elif self.eye_id == EyeId.LEFT:
|
||||
@ -312,7 +306,6 @@ class CameraWidget:
|
||||
|
||||
if event == self.gui_tracking_button:
|
||||
print("\033[94m[INFO] Moving to tracking mode\033[0m")
|
||||
self.update_wait_count = 100
|
||||
self.in_roi_mode = False
|
||||
self.camera.set_output_queue(self.capture_queue)
|
||||
window[self.gui_roi_layout].update(visible=False)
|
||||
@ -320,7 +313,6 @@ class CameraWidget:
|
||||
|
||||
if event == self.gui_roi_button:
|
||||
print("\033[94m[INFO] Move to roi mode\033[0m")
|
||||
self.update_wait_count = 100
|
||||
self.in_roi_mode = True
|
||||
self.camera.set_output_queue(self.roi_queue)
|
||||
window[self.gui_roi_layout].update(visible=True)
|
||||
@ -428,8 +420,6 @@ class CameraWidget:
|
||||
window[self.gui_output_graph].update(visible=False)
|
||||
return
|
||||
try:
|
||||
if self.update_wait_count >= 0:
|
||||
self.update_wait_count = self.update_wait_count - 1
|
||||
window[self.gui_roi_message].update(visible=False)
|
||||
window[self.gui_output_graph].update(visible=True)
|
||||
(maybe_image, eye_info) = self.image_queue.get(block=False)
|
||||
|
||||
@ -50,18 +50,9 @@ def run_model(input_queue, output_queue, session):
|
||||
if frame is None:
|
||||
break
|
||||
|
||||
# to_tensor = transforms.ToTensor()
|
||||
# img_tensor = to_tensor(frame)
|
||||
# img_tensor.unsqueeze_(0)
|
||||
# img_np = img_tensor.numpy()
|
||||
img_np = np.array(frame)
|
||||
# Normalize the pixel values to [0, 1] and convert the data type to float32
|
||||
img_np = img_np.astype(np.float32) / 255.0
|
||||
|
||||
# Transpose the dimensions from (height, width, channels) to (channels, height, width)
|
||||
img_np = np.transpose(img_np, (2, 0, 1))
|
||||
|
||||
# Add a batch dimension
|
||||
img_np = np.expand_dims(img_np, axis=0)
|
||||
ort_inputs = {session.get_inputs()[0].name: img_np}
|
||||
pre_landmark = session.run(None, ort_inputs)
|
||||
|
||||
1260
poetry.lock
generated
1260
poetry.lock
generated
File diff suppressed because it is too large
Load Diff
@ -7,7 +7,7 @@ license = "MIT"
|
||||
repository = "https://github.com/EyeTrackVR/EyeTrackVR"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "~3.10.0"
|
||||
python = "~3.11.0"
|
||||
python-osc = "^1.8.0"
|
||||
requests = "^2.28.1"
|
||||
opencv-python = "^4.6.0.66"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user