From e0217c23cc9fdb6cc9f8743515fbb8b3c7b46b16 Mon Sep 17 00:00:00 2001 From: will wade Date: Tue, 27 Jun 2023 16:30:16 +0100 Subject: [PATCH 01/33] initial attempt working but needs to run as admin --- installer.iss | 42 +++++++++++++++++++++++++++++ run_app.py | 20 +++++++++----- src/gui/pages/page_select_camera.py | 2 +- 3 files changed, 56 insertions(+), 8 deletions(-) create mode 100644 installer.iss diff --git a/installer.iss b/installer.iss new file mode 100644 index 00000000..bdd887a3 --- /dev/null +++ b/installer.iss @@ -0,0 +1,42 @@ +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +#define MyAppName "Gameface" +#define MyAppVersion "1" +#define MyAppExeName "run_app.exe" + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{B266B614-4113-4DB7-9A30-4250FECA5009} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +;AppVerName={#MyAppName} {#MyAppVersion} +DefaultDirName={autopf}\{#MyAppName} +DisableProgramGroupPage=yes +; Uncomment the following line to run in non administrative install mode (install for current user only.) +;PrivilegesRequired=lowest +OutputBaseFilename=mysetup +SetupIconFile=assets\images\icon.ico +Compression=lzma +SolidCompression=yes +WizardStyle=modern + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + +[Files] +Source: "dist\project_gameface\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion +Source: "dist\project_gameface\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" +Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon + +[Run] +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent + diff --git a/run_app.py b/run_app.py index 2ddb7640..c532e7d7 100644 --- a/run_app.py +++ b/run_app.py @@ -14,6 +14,7 @@ import logging import sys +import os import customtkinter import src.gui as gui @@ -21,16 +22,21 @@ from src.pipeline import Pipeline FORMAT = "%(asctime)s %(levelname)s %(name)s: %(funcName)s: %(message)s" -logging.basicConfig(format=FORMAT, - level=logging.INFO, - handlers=[ - logging.FileHandler("log.txt", mode='w'), - logging.StreamHandler(sys.stdout) - ]) +if not os.path.isdir("C:\\Temp\\"): + os.mkdir("C:\\Temp\\") + +logging.basicConfig( + format=FORMAT, + level=logging.INFO, + handlers=[ + logging.FileHandler("C:\Temp\log.txt", mode="w"), + logging.StreamHandler(sys.stdout), + ], +) -class MainApp(gui.MainGui, Pipeline): +class MainApp(gui.MainGui, Pipeline): def __init__(self, tk_root): super().__init__(tk_root) # Wait for window drawing. diff --git a/src/gui/pages/page_select_camera.py b/src/gui/pages/page_select_camera.py index e540903a..7bf12c04 100644 --- a/src/gui/pages/page_select_camera.py +++ b/src/gui/pages/page_select_camera.py @@ -54,7 +54,7 @@ def __init__(self, master, **kwargs): self.label.grid(row=1, column=0, padx=10, pady=(20, 10), sticky="nw") # Empty radio buttons - self.radio_var = tkinter.IntVar(0) + self.radio_var = tkinter.IntVar(value=0) self.prev_radio_value = None self.radios = [] From cd57d88ecc8f63d69196590c771069a9ea89eb52 Mon Sep 17 00:00:00 2001 From: will wade Date: Tue, 27 Jun 2023 19:41:05 +0100 Subject: [PATCH 02/33] runas admin version --- installer.iss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer.iss b/installer.iss index bdd887a3..95419747 100644 --- a/installer.iss +++ b/installer.iss @@ -38,5 +38,5 @@ Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon [Run] -Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent shellexec; Verb: runas From 7f5d322334dc129682a41991aa0990bd94c8b22e Mon Sep 17 00:00:00 2001 From: will wade Date: Tue, 27 Jun 2023 19:48:39 +0100 Subject: [PATCH 03/33] creating inno6 version of our build gh action --- .github/workflows/windows-build-release.yml | 32 +++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/windows-build-release.yml diff --git a/.github/workflows/windows-build-release.yml b/.github/workflows/windows-build-release.yml new file mode 100644 index 00000000..397bfe9d --- /dev/null +++ b/.github/workflows/windows-build-release.yml @@ -0,0 +1,32 @@ +on: + workflow_dispatch: + push: + branches: + - master + - inno6-installer + pull_request: + +jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Build + run: | + pyinstaller build.spec + - name: Build Installer + run: | + iscc installer.iss + - name: Upload exe + uses: actions/upload-artifact@v3 + with: + name: 'Windows Release' + path: 'GameFace Setup.exe' \ No newline at end of file From 40705fbb60d9506dc60035102484ccd1618070f9 Mon Sep 17 00:00:00 2001 From: will wade Date: Tue, 27 Jun 2023 19:55:09 +0100 Subject: [PATCH 04/33] updating requirements --- requirements.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 0c89912b..5b365d1b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,6 +5,7 @@ opencv-contrib-python==4.7.0.72 psutil==5.9.4 pyautogui==0.9.53 customtkinter==5.1.2 -PyDirectInput==1.0.4 -pywin32==306 -mediapipe==0.9.3.0 \ No newline at end of file +mediapipe==0.9.3.0 +PyDirectInput==1.0.4; sys_platform == 'win32' +pywin32==306; sys_platform == 'win32' +pyinstaller==5.11.0 From 4c0a6711bec81473c44245fa6ea0dd1baf90ffef Mon Sep 17 00:00:00 2001 From: will wade Date: Tue, 27 Jun 2023 20:03:55 +0100 Subject: [PATCH 05/33] mysetup -> projectGameface Installer --- installer.iss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer.iss b/installer.iss index 95419747..4fd190b5 100644 --- a/installer.iss +++ b/installer.iss @@ -16,7 +16,7 @@ DefaultDirName={autopf}\{#MyAppName} DisableProgramGroupPage=yes ; Uncomment the following line to run in non administrative install mode (install for current user only.) ;PrivilegesRequired=lowest -OutputBaseFilename=mysetup +OutputBaseFilename=ProjectGameFace-Installer SetupIconFile=assets\images\icon.ico Compression=lzma SolidCompression=yes From 2dc590f9a03e31a66582c09d2ee268a2d1bd8ca1 Mon Sep 17 00:00:00 2001 From: will wade Date: Tue, 27 Jun 2023 20:07:20 +0100 Subject: [PATCH 06/33] adding readme details --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 29d86a7a..fcf741ca 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,20 @@ Project Gameface helps gamers control their mouse cursor using their head moveme -# Download +# Download + +## Single portable directory + 1. Download the program from [Release section](../../releases/) 2. Run `run_app.exe` +## Installer + +1. Download the Gameface-Installer.exe from [Release section](../../releases/) +2. Install it +3. Run from your Windows shortucts/desktop + # Model used MediaPipe Face Landmark Detection API [Task Guide](https://developers.google.com/mediapipe/solutions/vision/face_landmarker) @@ -88,7 +97,13 @@ gesture_name: [device_name, action_name, threshold, trigger_type] # Build + +## Pyinstaller / Frozen app ``` pyinstaller build.spec ``` +# Build Installer + +1. Install [inno6](https://jrsoftware.org/isdl.php#stable) +2. Build using the `installer.iss` file \ No newline at end of file From 7bb3107d6f598adcdd58e7fff2276edac965f011 Mon Sep 17 00:00:00 2001 From: will wade Date: Tue, 27 Jun 2023 21:46:43 +0100 Subject: [PATCH 07/33] Update windows-build-release.yml --- .github/workflows/windows-build-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-build-release.yml b/.github/workflows/windows-build-release.yml index 397bfe9d..b1308b85 100644 --- a/.github/workflows/windows-build-release.yml +++ b/.github/workflows/windows-build-release.yml @@ -29,4 +29,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: 'Windows Release' - path: 'GameFace Setup.exe' \ No newline at end of file + path: 'ProjectGameFace-Installer.exe' From 417da76934e04b1a7db0dafb7723e9af68fef895 Mon Sep 17 00:00:00 2001 From: will wade Date: Tue, 27 Jun 2023 21:56:34 +0100 Subject: [PATCH 08/33] reverting to installer name --- installer.iss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer.iss b/installer.iss index 4fd190b5..a2863427 100644 --- a/installer.iss +++ b/installer.iss @@ -16,7 +16,7 @@ DefaultDirName={autopf}\{#MyAppName} DisableProgramGroupPage=yes ; Uncomment the following line to run in non administrative install mode (install for current user only.) ;PrivilegesRequired=lowest -OutputBaseFilename=ProjectGameFace-Installer +OutputBaseFilename='GameFace Installer.exe' SetupIconFile=assets\images\icon.ico Compression=lzma SolidCompression=yes From 8c2f71e64ff82cb8e7d992d7dfe53e95f22aacfb Mon Sep 17 00:00:00 2001 From: will wade Date: Tue, 27 Jun 2023 21:56:59 +0100 Subject: [PATCH 09/33] reverting binary name --- .github/workflows/windows-build-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-build-release.yml b/.github/workflows/windows-build-release.yml index b1308b85..288048bb 100644 --- a/.github/workflows/windows-build-release.yml +++ b/.github/workflows/windows-build-release.yml @@ -29,4 +29,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: 'Windows Release' - path: 'ProjectGameFace-Installer.exe' + path: 'GameFace Installer.exe' From 9392ad030947ce5eb1f14f6d1b3e5000a135defc Mon Sep 17 00:00:00 2001 From: will wade Date: Tue, 27 Jun 2023 22:08:53 +0100 Subject: [PATCH 10/33] trying diff way of doing name --- installer.iss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer.iss b/installer.iss index a2863427..5d573a96 100644 --- a/installer.iss +++ b/installer.iss @@ -16,7 +16,7 @@ DefaultDirName={autopf}\{#MyAppName} DisableProgramGroupPage=yes ; Uncomment the following line to run in non administrative install mode (install for current user only.) ;PrivilegesRequired=lowest -OutputBaseFilename='GameFace Installer.exe' +OutputBaseFilename=GameFace Installer SetupIconFile=assets\images\icon.ico Compression=lzma SolidCompression=yes From fa17bd6f3c1b2b040a0341cfbae802c18bb24ddf Mon Sep 17 00:00:00 2001 From: will wade Date: Tue, 27 Jun 2023 22:31:37 +0100 Subject: [PATCH 11/33] a fix for #7 Amazing this works in the current build. https://github.com/google/project-gameface/issues/7 --- assets/themes/google_theme.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/themes/google_theme.json b/assets/themes/google_theme.json index b9fe9d4e..7ff52a30 100644 --- a/assets/themes/google_theme.json +++ b/assets/themes/google_theme.json @@ -48,7 +48,7 @@ "corner_radius": 500, "border_width": 0, "button_length": 0, - "fg_Color": ["#444746", "#4A4D50"], + "fg_color": ["#444746", "#4A4D50"], "progress_color": ["#64DD17", "#1f538d"], "button_color": ["#8F8F8F", "#D5D9DE"], "button_hover_color": ["gray20", "gray100"], From 9225d13fd4ea9832f7f0e2682c5fedd9b80cb7e6 Mon Sep 17 00:00:00 2001 From: will wade Date: Wed, 28 Jun 2023 14:29:04 +0100 Subject: [PATCH 12/33] migrating config saving to C:/Users//Gameface/ --- src/config_manager.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/config_manager.py b/src/config_manager.py index ad7a8bbc..bb69358c 100644 --- a/src/config_manager.py +++ b/src/config_manager.py @@ -18,6 +18,7 @@ import tkinter as tk import time import shutil +import os from pathlib import Path from src.singleton_meta import Singleton @@ -25,12 +26,20 @@ VERSION = "0.3.30" -DEFAULT_JSON = Path("configs/default.json") -BACKUP_PROFILE = Path("configs/default") +DEFAULT_JSON = Path(f"C:/Users/{os.getlogin()}/Gameface/configs/default.json") +BACKUP_PROFILE = Path(f"C:/Users/{os.getlogin()}/Gameface/configs/default") logger = logging.getLogger("ConfigManager") +if not os.path.isdir(f"C:/Users/{os.getlogin()}/Gameface/configs/"): + shutil.copytree("configs", f"C:/Users/{os.getlogin()}/Gameface/configs/") + os.mkdir(f"C:/Users/{os.getlogin()}/configs/") + +if not os.path.isdir(f"C:/Users/{os.getlogin()}/Gameface/configs/default"): + os.mkdir(f"C:/Users/{os.getlogin()}/Gameface/configs/default") + + class ConfigManager(metaclass=Singleton): def __init__(self): From 0c4dcc74b5e201db062b4b15f0b5fa9a2e2c1770 Mon Sep 17 00:00:00 2001 From: will wade Date: Wed, 28 Jun 2023 14:44:12 +0100 Subject: [PATCH 13/33] fixing location of path for binary --- .github/workflows/windows-build-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-build-release.yml b/.github/workflows/windows-build-release.yml index 288048bb..2c6bf2fe 100644 --- a/.github/workflows/windows-build-release.yml +++ b/.github/workflows/windows-build-release.yml @@ -29,4 +29,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: 'Windows Release' - path: 'GameFace Installer.exe' + path: '\a\project-gameface\project-gameface\Output\GameFace Installer.exe' From 716ca9790dda5b9ef3afbdd3f0f9d1fa383c316c Mon Sep 17 00:00:00 2001 From: will wade Date: Wed, 28 Jun 2023 15:52:24 +0100 Subject: [PATCH 14/33] fixing color? --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5b365d1b..d6db6ffb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ matplotlib==3.7.1 opencv-contrib-python==4.7.0.72 psutil==5.9.4 pyautogui==0.9.53 -customtkinter==5.1.2 +customtkinter mediapipe==0.9.3.0 PyDirectInput==1.0.4; sys_platform == 'win32' pywin32==306; sys_platform == 'win32' From 70e95e124c5fad2a3b65fbad75ad115c1b15e3c3 Mon Sep 17 00:00:00 2001 From: will wade Date: Wed, 28 Jun 2023 15:53:15 +0100 Subject: [PATCH 15/33] fixing verrsion to latest for customtkinter --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d6db6ffb..1bad4ace 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ matplotlib==3.7.1 opencv-contrib-python==4.7.0.72 psutil==5.9.4 pyautogui==0.9.53 -customtkinter +customtkinter==5.2.0 mediapipe==0.9.3.0 PyDirectInput==1.0.4; sys_platform == 'win32' pywin32==306; sys_platform == 'win32' From 2b196a1dd6c8e4aacef448817008d3ec1d4e55f6 Mon Sep 17 00:00:00 2001 From: will wade Date: Wed, 28 Jun 2023 16:14:03 +0100 Subject: [PATCH 16/33] add icon for app --- build.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.spec b/build.spec index f9e3c58d..05966603 100644 --- a/build.spec +++ b/build.spec @@ -48,6 +48,7 @@ exe_app = EXE( disable_windowed_traceback=False, argv_emulation=False, target_arch=None, + icon='assets/images/icon.ico', codesign_identity=None, entitlements_file=None, ) @@ -62,4 +63,4 @@ coll = COLLECT( upx=True, upx_exclude=[], name='project_gameface', -) +) \ No newline at end of file From c23b1a1895b0d646c732c8d643e141a0055b61eb Mon Sep 17 00:00:00 2001 From: will wade Date: Wed, 28 Jun 2023 22:38:32 +0100 Subject: [PATCH 17/33] fiximg issues with fgcolor --- assets/themes/google_theme.json | 2 +- build.spec | 2 +- installer.iss | 4 ++-- src/shape_list.py | 2 -- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/assets/themes/google_theme.json b/assets/themes/google_theme.json index 7ff52a30..b9fe9d4e 100644 --- a/assets/themes/google_theme.json +++ b/assets/themes/google_theme.json @@ -48,7 +48,7 @@ "corner_radius": 500, "border_width": 0, "button_length": 0, - "fg_color": ["#444746", "#4A4D50"], + "fg_Color": ["#444746", "#4A4D50"], "progress_color": ["#64DD17", "#1f538d"], "button_color": ["#8F8F8F", "#D5D9DE"], "button_hover_color": ["gray20", "gray100"], diff --git a/build.spec b/build.spec index 05966603..ed216f80 100644 --- a/build.spec +++ b/build.spec @@ -63,4 +63,4 @@ coll = COLLECT( upx=True, upx_exclude=[], name='project_gameface', -) \ No newline at end of file +) diff --git a/installer.iss b/installer.iss index 5d573a96..eb6e9c99 100644 --- a/installer.iss +++ b/installer.iss @@ -16,7 +16,7 @@ DefaultDirName={autopf}\{#MyAppName} DisableProgramGroupPage=yes ; Uncomment the following line to run in non administrative install mode (install for current user only.) ;PrivilegesRequired=lowest -OutputBaseFilename=GameFace Installer +OutputBaseFilename=mysetup SetupIconFile=assets\images\icon.ico Compression=lzma SolidCompression=yes @@ -38,5 +38,5 @@ Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon [Run] -Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent shellexec; Verb: runas +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Verb: runas; Flags: postinstall skipifsilent shellexec runascurrentuser waituntilterminated; diff --git a/src/shape_list.py b/src/shape_list.py index 3a89ca7f..45f483de 100644 --- a/src/shape_list.py +++ b/src/shape_list.py @@ -85,9 +85,7 @@ "Open mouth": "assets/images/dropdowns/Open mouth.png", "Mouth left": "assets/images/dropdowns/Mouth left.png", "Mouth right": "assets/images/dropdowns/Mouth right.png", - "Roll lower mouth": "assets/images/dropdowns/Roll lower mouth.png", "Raise left eyebrow": "assets/images/dropdowns/Raise left eyebrow.png", - "Lower left eyebrow": "assets/images/dropdowns/Lower left eyebrow.png", "Raise right eyebrow": "assets/images/dropdowns/Raise right eyebrow.png", "Lower right eyebrow": "assets/images/dropdowns/Lower right eyebrow.png", } From 970bd16057d7f5a43ca619f4a6a628407d5c61f4 Mon Sep 17 00:00:00 2001 From: will wade Date: Wed, 28 Jun 2023 22:48:31 +0100 Subject: [PATCH 18/33] reputting in correct name of app --- installer.iss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer.iss b/installer.iss index eb6e9c99..24751962 100644 --- a/installer.iss +++ b/installer.iss @@ -16,7 +16,7 @@ DefaultDirName={autopf}\{#MyAppName} DisableProgramGroupPage=yes ; Uncomment the following line to run in non administrative install mode (install for current user only.) ;PrivilegesRequired=lowest -OutputBaseFilename=mysetup +OutputBaseFilename=GameFace Installer SetupIconFile=assets\images\icon.ico Compression=lzma SolidCompression=yes From 552879bbb08dc33ead5ffbf2751292688f428770 Mon Sep 17 00:00:00 2001 From: will wade Date: Wed, 28 Jun 2023 22:53:51 +0100 Subject: [PATCH 19/33] testing log path to Gameface user dir --- run_app.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/run_app.py b/run_app.py index c532e7d7..142ded1c 100644 --- a/run_app.py +++ b/run_app.py @@ -23,14 +23,15 @@ FORMAT = "%(asctime)s %(levelname)s %(name)s: %(funcName)s: %(message)s" -if not os.path.isdir("C:\\Temp\\"): - os.mkdir("C:\\Temp\\") +log_path = os.environ['USERPROFILE']+'\Gameface' +if not os.path.isdir(log_path): + os.mkdir(log_path) logging.basicConfig( format=FORMAT, level=logging.INFO, handlers=[ - logging.FileHandler("C:\Temp\log.txt", mode="w"), + logging.FileHandler(log_path+'\log.txt", mode="w"), logging.StreamHandler(sys.stdout), ], ) From 13f73b1ef2231cb5be7f92fc71a2efc286650dab Mon Sep 17 00:00:00 2001 From: will wade Date: Wed, 28 Jun 2023 22:58:58 +0100 Subject: [PATCH 20/33] stupid typo --- run_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_app.py b/run_app.py index 142ded1c..f2807bc5 100644 --- a/run_app.py +++ b/run_app.py @@ -31,7 +31,7 @@ format=FORMAT, level=logging.INFO, handlers=[ - logging.FileHandler(log_path+'\log.txt", mode="w"), + logging.FileHandler(log_path+'\log.txt', mode="w"), logging.StreamHandler(sys.stdout), ], ) From 9212f7d96588ee363dcd16c971e97e4a0044b755 Mon Sep 17 00:00:00 2001 From: will wade Date: Wed, 28 Jun 2023 23:09:37 +0100 Subject: [PATCH 21/33] gah had reverted the switch color bug --- assets/themes/google_theme.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/themes/google_theme.json b/assets/themes/google_theme.json index b9fe9d4e..7ff52a30 100644 --- a/assets/themes/google_theme.json +++ b/assets/themes/google_theme.json @@ -48,7 +48,7 @@ "corner_radius": 500, "border_width": 0, "button_length": 0, - "fg_Color": ["#444746", "#4A4D50"], + "fg_color": ["#444746", "#4A4D50"], "progress_color": ["#64DD17", "#1f538d"], "button_color": ["#8F8F8F", "#D5D9DE"], "button_hover_color": ["gray20", "gray100"], From 22a1490fc920c1589b6b31e87b6df7f29b83f9c3 Mon Sep 17 00:00:00 2001 From: will wade Date: Thu, 29 Jun 2023 13:34:55 +0100 Subject: [PATCH 22/33] build portable and autostart re https://github.com/google/project-gameface/issues/33 --- .github/workflows/windows-build-release.yml | 2 +- build-portable.spec | 57 +++++++++++++++++++++ installer.iss | 4 ++ 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 build-portable.spec diff --git a/.github/workflows/windows-build-release.yml b/.github/workflows/windows-build-release.yml index 2c6bf2fe..e0103304 100644 --- a/.github/workflows/windows-build-release.yml +++ b/.github/workflows/windows-build-release.yml @@ -21,7 +21,7 @@ jobs: pip install -r requirements.txt - name: Build run: | - pyinstaller build.spec + pyinstaller build-portable.spec - name: Build Installer run: | iscc installer.iss diff --git a/build-portable.spec b/build-portable.spec new file mode 100644 index 00000000..0f259e03 --- /dev/null +++ b/build-portable.spec @@ -0,0 +1,57 @@ +# -*- mode: python ; coding: utf-8 -*- + +from pathlib import Path +import mediapipe +import customtkinter + +block_cipher = None + +mp_init = Path(mediapipe.__file__) +mp_modules = Path(mp_init.parent,"modules") + +ctk_init = Path(customtkinter.__file__) +ctk_modules = Path(ctk_init.parent,"modules") + + + +app = Analysis( + ['run_app.py'], + pathex=[], + binaries=[], + datas=[(mp_modules.as_posix(), 'mediapipe/modules'), + ('assets','assets'), + ('configs','configs'), + (ctk_init.parent.as_posix(), 'customtkinter')], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False, +) +pyz_app = PYZ(app.pure, app.zipped_data, cipher=block_cipher) + +exe = EXE( + pyz_app, + app.scripts, + app.binaries, + app.zipfiles, + app.datas, + [], + name='run_app', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + runtime_tmpdir=None, + console=False, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, + icon='assets/images/icon.ico', +) diff --git a/installer.iss b/installer.iss index 24751962..6717248d 100644 --- a/installer.iss +++ b/installer.iss @@ -27,6 +27,8 @@ Name: "english"; MessagesFile: "compiler:Default.isl" [Tasks] Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked +Name: "autostarticon"; Description: "{cm:AutoStartProgram,{#MyAppName}}"; GroupDescription: "{cm:AdditionalIcons}"; + [Files] Source: "dist\project_gameface\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion @@ -36,6 +38,8 @@ Source: "dist\project_gameface\*"; DestDir: "{app}"; Flags: ignoreversion recurs [Icons] Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon +Name: "{userstartup}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Parameters: "/auto"; Tasks: autostarticon +; Name: "{commonstartup}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Parameters: "/auto"; Tasks: autostarticon [Run] Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Verb: runas; Flags: postinstall skipifsilent shellexec runascurrentuser waituntilterminated; From 11612e00e0fcb49dbfdafaee737f29e02e10558c Mon Sep 17 00:00:00 2001 From: will wade Date: Thu, 29 Jun 2023 14:19:27 +0100 Subject: [PATCH 23/33] adding portable build --- .github/workflows/windows-build-release.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-build-release.yml b/.github/workflows/windows-build-release.yml index e0103304..20ec1d75 100644 --- a/.github/workflows/windows-build-release.yml +++ b/.github/workflows/windows-build-release.yml @@ -21,12 +21,21 @@ jobs: pip install -r requirements.txt - name: Build run: | - pyinstaller build-portable.spec + pyinstaller --distpath dist-portable build-portable.spec + Copy-Item -Path assets -Destination dist-portable\ -Recurse + Copy-Item -Path configs -Destination dist-portable\ -Recurse + Compress-Archive -Path dist-portable -DestinationPath GameFaceInstaller.zip + pyinstaller build.spec - name: Build Installer run: | iscc installer.iss - - name: Upload exe + - name: Upload installer uses: actions/upload-artifact@v3 with: name: 'Windows Release' path: '\a\project-gameface\project-gameface\Output\GameFace Installer.exe' + - name: Upload portable + uses: actions/upload-artifact@v3 + with: + name: 'Windows Release' + path: '\a\project-gameface\project-gameface\GameFacePortable.exe' From fdb222756da67e862f67b7043448951c3380a64f Mon Sep 17 00:00:00 2001 From: will wade Date: Thu, 29 Jun 2023 14:20:55 +0100 Subject: [PATCH 24/33] stupid typo --- .github/workflows/windows-build-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-build-release.yml b/.github/workflows/windows-build-release.yml index 20ec1d75..228567db 100644 --- a/.github/workflows/windows-build-release.yml +++ b/.github/workflows/windows-build-release.yml @@ -24,7 +24,7 @@ jobs: pyinstaller --distpath dist-portable build-portable.spec Copy-Item -Path assets -Destination dist-portable\ -Recurse Copy-Item -Path configs -Destination dist-portable\ -Recurse - Compress-Archive -Path dist-portable -DestinationPath GameFaceInstaller.zip + Compress-Archive -Path dist-portable -DestinationPath GameFacePortable.zip pyinstaller build.spec - name: Build Installer run: | From 701dff23b0496917500fa95069c5d5f424a13834 Mon Sep 17 00:00:00 2001 From: will wade Date: Thu, 29 Jun 2023 18:15:36 +0100 Subject: [PATCH 25/33] clearer sections for zipping --- .github/workflows/windows-build-release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows-build-release.yml b/.github/workflows/windows-build-release.yml index 228567db..7de6c2bf 100644 --- a/.github/workflows/windows-build-release.yml +++ b/.github/workflows/windows-build-release.yml @@ -22,10 +22,12 @@ jobs: - name: Build run: | pyinstaller --distpath dist-portable build-portable.spec + pyinstaller build.spec + - name: Zip Portable + run: | Copy-Item -Path assets -Destination dist-portable\ -Recurse Copy-Item -Path configs -Destination dist-portable\ -Recurse Compress-Archive -Path dist-portable -DestinationPath GameFacePortable.zip - pyinstaller build.spec - name: Build Installer run: | iscc installer.iss From 7cb0bfdd8ec2ef740d25b989d7eb58f29a03e28f Mon Sep 17 00:00:00 2001 From: will wade Date: Thu, 29 Jun 2023 22:03:15 +0100 Subject: [PATCH 26/33] see if shell: pwsh fixes things --- .github/workflows/windows-build-release.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/windows-build-release.yml b/.github/workflows/windows-build-release.yml index 7de6c2bf..98c91720 100644 --- a/.github/workflows/windows-build-release.yml +++ b/.github/workflows/windows-build-release.yml @@ -19,18 +19,21 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - - name: Build + - name: Freeze Installer run: | pyinstaller --distpath dist-portable build-portable.spec - pyinstaller build.spec + - name: Build Installer + run: | + iscc installer.iss + - name: Freeze portable + run: | + pyinstaller build.spec - name: Zip Portable + shell: pwsh run: | Copy-Item -Path assets -Destination dist-portable\ -Recurse Copy-Item -Path configs -Destination dist-portable\ -Recurse Compress-Archive -Path dist-portable -DestinationPath GameFacePortable.zip - - name: Build Installer - run: | - iscc installer.iss - name: Upload installer uses: actions/upload-artifact@v3 with: From 4a136f4352b4db40a672e8dc9f02309f5fec8540 Mon Sep 17 00:00:00 2001 From: will wade Date: Thu, 29 Jun 2023 22:09:24 +0100 Subject: [PATCH 27/33] swap installer and portable --- .github/workflows/windows-build-release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows-build-release.yml b/.github/workflows/windows-build-release.yml index 98c91720..84856f59 100644 --- a/.github/workflows/windows-build-release.yml +++ b/.github/workflows/windows-build-release.yml @@ -21,13 +21,13 @@ jobs: pip install -r requirements.txt - name: Freeze Installer run: | - pyinstaller --distpath dist-portable build-portable.spec + pyinstaller build.spec - name: Build Installer run: | - iscc installer.iss - - name: Freeze portable + iscc installer.iss + - name: Freeze Portable run: | - pyinstaller build.spec + pyinstaller --distpath dist-portable build-portable.spec - name: Zip Portable shell: pwsh run: | From a60eba5cd3a48b726ed799169ed30f332083983d Mon Sep 17 00:00:00 2001 From: will wade Date: Thu, 29 Jun 2023 22:17:45 +0100 Subject: [PATCH 28/33] d'oh! its a zip not a exe --- .github/workflows/windows-build-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-build-release.yml b/.github/workflows/windows-build-release.yml index 84856f59..04f71a0b 100644 --- a/.github/workflows/windows-build-release.yml +++ b/.github/workflows/windows-build-release.yml @@ -43,4 +43,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: 'Windows Release' - path: '\a\project-gameface\project-gameface\GameFacePortable.exe' + path: '\a\project-gameface\project-gameface\GameFacePortable.zip' From 58463472f5922170cc598bf27ebb57eda257bfa3 Mon Sep 17 00:00:00 2001 From: will wade Date: Thu, 29 Jun 2023 22:27:11 +0100 Subject: [PATCH 29/33] one last thing --- .github/workflows/windows-build-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-build-release.yml b/.github/workflows/windows-build-release.yml index 04f71a0b..318a29b6 100644 --- a/.github/workflows/windows-build-release.yml +++ b/.github/workflows/windows-build-release.yml @@ -37,10 +37,10 @@ jobs: - name: Upload installer uses: actions/upload-artifact@v3 with: - name: 'Windows Release' + name: 'Windows Installer Release' path: '\a\project-gameface\project-gameface\Output\GameFace Installer.exe' - name: Upload portable uses: actions/upload-artifact@v3 with: - name: 'Windows Release' + name: 'Windows Portable Release' path: '\a\project-gameface\project-gameface\GameFacePortable.zip' From 6ad745260de9ebf68ee49ab56a2d6c0640a416ed Mon Sep 17 00:00:00 2001 From: will wade Date: Fri, 30 Jun 2023 13:04:52 +0100 Subject: [PATCH 30/33] unchecking desktop defaults --- installer.iss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer.iss b/installer.iss index 6717248d..5cd53243 100644 --- a/installer.iss +++ b/installer.iss @@ -26,7 +26,7 @@ WizardStyle=modern Name: "english"; MessagesFile: "compiler:Default.isl" [Tasks] -Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Name: "autostarticon"; Description: "{cm:AutoStartProgram,{#MyAppName}}"; GroupDescription: "{cm:AdditionalIcons}"; From d94dbbd4470a9c858220b41c3c957b3e94a1f6d5 Mon Sep 17 00:00:00 2001 From: will wade Date: Mon, 13 Nov 2023 09:32:22 +0000 Subject: [PATCH 31/33] Update src/config_manager.py Co-authored-by: acidcoke --- src/config_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config_manager.py b/src/config_manager.py index bb69358c..ab6d60d4 100644 --- a/src/config_manager.py +++ b/src/config_manager.py @@ -34,7 +34,7 @@ if not os.path.isdir(f"C:/Users/{os.getlogin()}/Gameface/configs/"): shutil.copytree("configs", f"C:/Users/{os.getlogin()}/Gameface/configs/") - os.mkdir(f"C:/Users/{os.getlogin()}/configs/") + os.mkdir(f"C:/Users/{os.getlogin()}/Gameface/configs/") if not os.path.isdir(f"C:/Users/{os.getlogin()}/Gameface/configs/default"): os.mkdir(f"C:/Users/{os.getlogin()}/Gameface/configs/default") From dbeda438856ef13985d0a67a3e3d412ef08e9cb6 Mon Sep 17 00:00:00 2001 From: will wade Date: Mon, 13 Nov 2023 09:34:20 +0000 Subject: [PATCH 32/33] Update README.md updating 3.10 to follow GH Action --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fcf741ca..ca0b6192 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ MediaPipe Face Landmark Detection API [Task Guide](https://developers.google.com ## Installation > Environment >- Windows ->- Python 3.9 +>- Python 3.10 ``` pip install -r requirements.txt ``` @@ -106,4 +106,4 @@ gesture_name: [device_name, action_name, threshold, trigger_type] # Build Installer 1. Install [inno6](https://jrsoftware.org/isdl.php#stable) -2. Build using the `installer.iss` file \ No newline at end of file +2. Build using the `installer.iss` file From 4054ea86205322bfaea741b294740222ee34ab7d Mon Sep 17 00:00:00 2001 From: will wade Date: Mon, 13 Nov 2023 09:36:03 +0000 Subject: [PATCH 33/33] putting back in missing actions --- src/shape_list.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/shape_list.py b/src/shape_list.py index 45f483de..3a89ca7f 100644 --- a/src/shape_list.py +++ b/src/shape_list.py @@ -85,7 +85,9 @@ "Open mouth": "assets/images/dropdowns/Open mouth.png", "Mouth left": "assets/images/dropdowns/Mouth left.png", "Mouth right": "assets/images/dropdowns/Mouth right.png", + "Roll lower mouth": "assets/images/dropdowns/Roll lower mouth.png", "Raise left eyebrow": "assets/images/dropdowns/Raise left eyebrow.png", + "Lower left eyebrow": "assets/images/dropdowns/Lower left eyebrow.png", "Raise right eyebrow": "assets/images/dropdowns/Raise right eyebrow.png", "Lower right eyebrow": "assets/images/dropdowns/Lower right eyebrow.png", }