Reformat the files to use 4 spaces

This commit is contained in:
lorow 2022-06-14 00:03:17 +02:00 committed by qDot
parent d30b6fb37f
commit 1359bff868
4 changed files with 250 additions and 237 deletions

View File

@ -4,6 +4,7 @@ from dacite import from_dict
import os.path
import json
# TODO Who even needs synchronization? (We do.)
@dataclass
@ -19,6 +20,7 @@ class RansacConfig:
vrc_eye_position_scalar: "int" = 3000
show_color_image: "bool" = False
@staticmethod
def load():
if not os.path.exists("ransac_settings.json"):
print("No settings file, using base settings")

View File

@ -39,18 +39,27 @@ def main():
# Define the window's contents
tracking_layout = [
[sg.Text("Threshold"), sg.Slider(range=(0, 100), default_value=config.threshold, orientation = 'h', key=THRESHOLD_SLIDER_NAME)],
[sg.Text("Rotation"), sg.Slider(range=(0, 360), default_value=config.rotation_angle, orientation = 'h', key=ROTATION_SLIDER_NAME)],
[sg.Text("Eye Position Scalar"), sg.Slider(range=(0, 5000), default_value=config.vrc_eye_position_scalar, orientation = 'h', key=SCALAR_SLIDER_NAME)],
[sg.Button("Restart Calibration", key=RESTART_CALIBRATION_NAME), sg.Button("Recenter Eye", key=RECENTER_EYE_NAME), sg.Checkbox('Show Color Image:', default=config.show_color_image, key=SHOW_COLOR_IMAGE_NAME)],
[sg.Text("Threshold"),
sg.Slider(range=(0, 100), default_value=config.threshold, orientation='h', key=THRESHOLD_SLIDER_NAME)],
[sg.Text("Rotation"),
sg.Slider(range=(0, 360), default_value=config.rotation_angle, orientation='h', key=ROTATION_SLIDER_NAME)],
[sg.Text("Eye Position Scalar"),
sg.Slider(range=(0, 5000), default_value=config.vrc_eye_position_scalar, orientation='h',
key=SCALAR_SLIDER_NAME)],
[sg.Button("Restart Calibration", key=RESTART_CALIBRATION_NAME),
sg.Button("Recenter Eye", key=RECENTER_EYE_NAME),
sg.Checkbox('Show Color Image:', default=config.show_color_image, key=SHOW_COLOR_IMAGE_NAME)],
[sg.Text("Mode:"), sg.Text("Calibrating", key=MODE_READOUT_NAME)],
[sg.Image(filename="", key=TRACKING_IMAGE_NAME)],
[sg.Graph((200,200), (-100, 100), (100, -100), background_color='white', key=OUTPUT_GRAPH_NAME,drag_submits=True, enable_events=True)]
[sg.Graph((200, 200), (-100, 100), (100, -100), background_color='white', key=OUTPUT_GRAPH_NAME,
drag_submits=True, enable_events=True)]
]
layout = [[[sg.Text("Camera Address"), sg.InputText(config.capture_source, key=CAMERA_ADDR_NAME), sg.Button("Save and Restart Tracking", key=SAVE_TRACKING_BUTTON_NAME)]],
layout = [[[sg.Text("Camera Address"), sg.InputText(config.capture_source, key=CAMERA_ADDR_NAME),
sg.Button("Save and Restart Tracking", key=SAVE_TRACKING_BUTTON_NAME)]],
[sg.Button("Tracking Mode", key=TRACKING_BUTTON_NAME), sg.Button("ROI Mode", key=ROI_BUTTON_NAME)],
[sg.Column(tracking_layout, key=TRACKING_LAYOUT_NAME), sg.Column(roi_layout, key=ROI_LAYOUT_NAME, visible=False)]]
[sg.Column(tracking_layout, key=TRACKING_LAYOUT_NAME),
sg.Column(roi_layout, key=ROI_LAYOUT_NAME, visible=False)]]
# Create the window
window = sg.Window('Eye Tracking', layout)
@ -117,7 +126,7 @@ def main():
try:
# Try storing ints as ints, for those using wired cameras.
config.capture_source = int(values[CAMERA_ADDR_NAME])
except:
except ValueError:
config.capture_source = values[CAMERA_ADDR_NAME]
changed = True

View File

@ -2,6 +2,7 @@ from pythonosc import udp_client
import queue
import threading
class VRChatOSC:
# VRChat OSC Networking Info. For now, we'll assume it's always local.
OSC_IP = "127.0.0.1"

View File

@ -2,6 +2,7 @@ import pyttsx3
import queue
import threading
class SpeechEngine:
def __init__(self, queue: "queue.Queue[str | None]"):
self.engine = pyttsx3.init()