Skip to content

Commit 61d4e75

Browse files
committed
Release 1.198.2025
1 parent dae3dd1 commit 61d4e75

49 files changed

Lines changed: 3138 additions & 357 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Functions/GenXdev.AI.DeepStack/README.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ Set-WindowsPosition -Monitor 0 -Left
5151
## Prerequisites
5252

5353
- Docker Desktop installed and running
54-
- PowerShell 5.1 or later (PowerShell Core is also supported)
55-
- At least 4GB of available RAM (8GB recommended)
54+
- At least 16GB of available RAM
5655
- GPU with CUDA support (optional, for faster processing)
5756

5857
## Available Functions
@@ -127,18 +126,6 @@ Invoke-ImageEnhancement -ImagePath "C:\Users\You\Pictures\low_quality.jpg" -Outp
127126
Invoke-ImageEnhancement -ImagePath "C:\Users\You\Pictures\low_quality.jpg" -UseGPU -OutputPath "C:\Users\You\Pictures\enhanced.jpg"
128127
```
129128

130-
## DeepStack API Endpoints
131-
132-
The functions in this module interact with these DeepStack API endpoints:
133-
134-
- `POST /v1/vision/face/register` - Register known faces
135-
- `POST /v1/vision/face/recognize` - Recognize faces in an image
136-
- `POST /v1/vision/face/list` - List registered faces
137-
- `POST /v1/vision/face/delete` - Remove registered face
138-
- `POST /v1/vision/enhance` - Enhance image quality and size
139-
140-
## Troubleshooting
141-
142129
### Common Issues
143130

144131
- **Container Fails to Start**: Ensure you have sufficient memory and CPU resources
@@ -151,6 +138,7 @@ The functions in this module interact with these DeepStack API endpoints:
151138
To view the DeepStack server logs:
152139

153140
```powershell
141+
ensuredeepstack
154142
docker logs deepstack_face_recognition
155143
```
156144

Functions/GenXdev.AI.DeepStack/Register-AllFaces.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ function Register-AllFaces {
546546
catch {
547547

548548
# output warning for unexpected processing errors
549-
Microsoft.PowerShell.Utility\Write-Warning `
549+
Microsoft.PowerShell.Utility\Write-Verbose `
550550
("Unexpected error processing images for " +
551551
"$personName`: $_")
552552
}

Functions/GenXdev.AI.LMStudio/EnsureLMStudio.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ function EnsureLMStudio {
133133
try {
134134
$a = (GenXDev.Windows\Get-Window -ProcessName "LM Studio") ;
135135
if ($null -eq $a) { return }
136-
$a.Show()
137-
$a.Restore()
136+
$null = $a.Show()
137+
$null = $a.Restore()
138138
GenXDev.Windows\Set-WindowPosition -WindowHelper $a -Monitor 0 -Right
139139
GenXDev.Windows\Set-WindowPosition -Left -Monitor 0 -Left
140140
}

Functions/GenXdev.AI.LMStudio/Initialize-LMStudioModel.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,18 @@ function Initialize-LMStudioModel {
198198
if (-not $installationOk) {
199199
throw "LM Studio not found or properly installed"
200200
}
201+
202+
Microsoft.PowerShell.Utility\Start-Sleep 15
203+
Microsoft.PowerShell.Management\Get-Process "LM Studio" -ErrorAction SilentlyContinue | Microsoft.PowerShell.Management\Stop-Process -force
204+
$processOk = GenXdev.AI\Test-LMStudioProcess -ShowWindow:$ShowWindow
201205
}
202206

203207
$paths = GenXdev.AI\Get-LMStudioPaths
204208

205209
if (-not $processOk) {
206210

207211
# attempt to start the server asynchronously
208-
$null = GenXdev.AI\Start-LMStudioApplication -WithVisibleWindow:$ShowWindow
212+
$null = GenXdev.AI\Start-LMStudioApplication -ShowWindow:$ShowWindow
209213
}
210214
}
211215

Functions/GenXdev.AI.LMStudio/Start-LMStudioApplication.ps1

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Determines if the LM Studio window should be visible after starting.
1515
When specified, returns the Process object of the LM Studio application.
1616
1717
.EXAMPLE
18-
Start-LMStudioApplication -WithVisibleWindow -Passthru
18+
Start-LMStudioApplication -ShowWindow -Passthru
1919
#>
2020
function Start-LMStudioApplication {
2121

@@ -27,8 +27,7 @@ function Start-LMStudioApplication {
2727
Position = 0,
2828
HelpMessage = "Show or hide the LM Studio window after starting"
2929
)]
30-
[Alias("sw", "ShowWindow")]
31-
[switch]$WithVisibleWindow,
30+
[switch]$ShowWindow,
3231
########################################################################
3332
[Parameter(
3433
Mandatory = $false,
@@ -77,20 +76,18 @@ process {
7776
# start server component
7877
$null = Microsoft.PowerShell.Management\Start-Process `
7978
-FilePath $paths.LMSExe `
80-
-ArgumentList "server", "start", "--port", "1234" `
81-
-NoNewWindow
79+
-ArgumentList "server", "start", "--port", "1234"
8280
Microsoft.PowerShell.Utility\Start-Sleep -Seconds 4
81+
$null = Microsoft.PowerShell.Management\Start-Process `
82+
-FilePath $paths.LMStudioExe
83+
Microsoft.PowerShell.Utility\Start-Sleep -Seconds 4
84+
8385
}
8486
ArgumentList = @($paths, ($ShowWindow -eq $true))
8587
}
8688

8789
$null = Microsoft.PowerShell.Core\Start-Job @jobParams | Microsoft.PowerShell.Core\Wait-Job
8890

89-
if ($showWindow) {
90-
91-
$null = GenXdev.AI\Get-LMStudioWindow -ShowWindow -NoAutoStart -ErrorAction SilentlyContinue -WarningAction SilentlyContinue
92-
}
93-
9491
# verify process starts within timeout period
9592
Microsoft.PowerShell.Utility\Write-Verbose "Waiting for LM Studio process..."
9693
$timeout = 30
@@ -110,13 +107,25 @@ process {
110107

111108
# return process object if requested
112109
if ($Passthru) {
113-
Microsoft.PowerShell.Management\Get-Process -Name "LM Studio" -ErrorAction Stop
110+
Microsoft.PowerShell.Management\Get-Process -Name "LM Studio" -ErrorAction Stop |
111+
Microsoft.PowerShell.Core\Where-Object -Property MainWindowHandle -ne 0 |
112+
Microsoft.PowerShell.Utility\Select-Object -First 1
114113
}
115114
}
116115

117116
end {
118117
if ($ShowWindow -and $PSCmdlet.ShouldProcess("LM Studio", "Show window")) {
119-
$null = GenXdev.AI\Get-LMStudioWindow -NoAutoStart -ShowWindow -ErrorAction SilentlyContinue -WarningAction SilentlyContinue
118+
try {
119+
$a = (GenXDev.Windows\Get-Window -ProcessName "LM Studio") ;
120+
if ($null -eq $a) { return }
121+
$null = $a.Show()
122+
$null = $a.Restore()
123+
$null = GenXDev.Windows\Set-WindowPosition -WindowHelper $a -Monitor 0 -Right
124+
$null = GenXDev.Windows\Set-WindowPosition -Left -Monitor 0 -Left
125+
}
126+
catch {
127+
128+
}
120129
}
121130
}
122131
}

Functions/GenXdev.AI.LMStudio/Test-LMStudioProcess.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ function Test-LMStudioProcess {
1616
[OutputType([bool])]
1717
param (
1818
[Parameter(Mandatory = $false)]
19+
[Alias("sw")]
1920
[switch] $ShowWindow
2021
)
2122

Functions/GenXdev.AI.Queries/Add-EmoticonsToText.ps1

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,27 @@ function Add-EmoticonsToText {
118118
[Parameter(
119119
Mandatory = $false,
120120
HelpMessage = "The API key to use for the request")]
121-
[string] $ApiKey = $null
121+
[string] $ApiKey = $null,
122+
########################################################################
123+
# Use alternative settings stored in session for AI preferences like Language, Image collections, etc
124+
[Parameter(
125+
Mandatory = $false,
126+
HelpMessage = "Use alternative settings stored in session for AI preferences like Language, Image collections, etc"
127+
)]
128+
[switch] $SessionOnly,
129+
########################################################################
130+
[Parameter(
131+
Mandatory = $false,
132+
HelpMessage = "Clear alternative settings stored in session for AI preferences like Language, Image collections, etc"
133+
)]
134+
[switch] $ClearSession,
135+
########################################################################
136+
[Parameter(
137+
Mandatory = $false,
138+
HelpMessage = "Dont use alternative settings stored in session for AI preferences like Language, Image collections, etc"
139+
)]
140+
[Alias("FromPreferences")]
141+
[switch] $SkipSession
122142
########################################################################
123143
)
124144

Functions/GenXdev.AI.Queries/Add-ImageDirectories.ps1

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,38 @@ function Add-ImageDirectories {
4646
)]
4747
[ValidateNotNullOrEmpty()]
4848
[Alias("imagespath", "directories", "imgdirs", "imagedirectory")]
49-
[string[]] $ImageDirectories
50-
###############################################################################
49+
[string[]] $ImageDirectories,
50+
########################################################################
51+
# Use alternative settings stored in session for AI preferences like Language, Image collections, etc
52+
[Parameter(
53+
Mandatory = $false,
54+
HelpMessage = "Use alternative settings stored in session for AI preferences like Language, Image collections, etc"
55+
)]
56+
[switch] $SessionOnly,
57+
########################################################################
58+
[Parameter(
59+
Mandatory = $false,
60+
HelpMessage = "Clear alternative settings stored in session for AI preferences like Language, Image collections, etc"
61+
)]
62+
[switch] $ClearSession,
63+
########################################################################
64+
[Parameter(
65+
Mandatory = $false,
66+
HelpMessage = "Dont use alternative settings stored in session for AI preferences like Language, Image collections, etc"
67+
)]
68+
[Alias("FromPreferences")]
69+
[switch] $SkipSession
70+
########################################################################
5171
)
5272

5373
begin {
5474

5575
# retrieve current image directories configuration
56-
$currentConfig = GenXdev.AI\Get-AIImageCollection
76+
$params = GenXdev.Helpers\Copy-IdenticalParamValues `
77+
-BoundParameters $PSBoundParameters `
78+
-FunctionName "GenXdev.AI\Get-AIImageCollection" `
79+
-DefaultValues (Microsoft.PowerShell.Utility\Get-Variable -Scope Local -ErrorAction SilentlyContinue)
80+
$currentConfig = GenXdev.AI\Get-AIImageCollection @params
5781

5882
# initialize new collection to store all directories including existing ones
5983
$newDirectories = [System.Collections.Generic.List[string]]::new()
@@ -119,7 +143,10 @@ function Add-ImageDirectories {
119143

120144
# update configuration using the dedicated setter function
121145
GenXdev.AI\Set-AIImageCollection `
122-
-ImageDirectories $finalDirectories
146+
-ImageDirectories $finalDirectories `
147+
-SessionOnly:$SessionOnly `
148+
-ClearSession:$ClearSession `
149+
-SkipSession:$SkipSession
123150

124151
# display success confirmation to user with statistics
125152
Microsoft.PowerShell.Utility\Write-Host (

Functions/GenXdev.AI.Queries/ConvertFrom-CorporateSpeak.ps1

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,27 @@ function ConvertFrom-CorporateSpeak {
146146
[Parameter(
147147
Mandatory = $false,
148148
HelpMessage = "The API key to use for the request")]
149-
[string]$ApiKey = $null
149+
[string]$ApiKey = $null,
150+
########################################################################
151+
# Use alternative settings stored in session for AI preferences like Language, Image collections, etc
152+
[Parameter(
153+
Mandatory = $false,
154+
HelpMessage = "Use alternative settings stored in session for AI preferences like Language, Image collections, etc"
155+
)]
156+
[switch] $SessionOnly,
157+
########################################################################
158+
[Parameter(
159+
Mandatory = $false,
160+
HelpMessage = "Clear alternative settings stored in session for AI preferences like Language, Image collections, etc"
161+
)]
162+
[switch] $ClearSession,
163+
########################################################################
164+
[Parameter(
165+
Mandatory = $false,
166+
HelpMessage = "Dont use alternative settings stored in session for AI preferences like Language, Image collections, etc"
167+
)]
168+
[Alias("FromPreferences")]
169+
[switch] $SkipSession
150170
########################################################################
151171
)
152172

Functions/GenXdev.AI.Queries/ConvertFrom-DiplomaticSpeak.ps1

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,27 @@ function ConvertFrom-DiplomaticSpeak {
8383
[Parameter(
8484
Mandatory = $false,
8585
HelpMessage = "The API key to use for the request")]
86-
[string]$ApiKey = $null
86+
[string]$ApiKey = $null,
87+
########################################################################
88+
# Use alternative settings stored in session for AI preferences like Language, Image collections, etc
89+
[Parameter(
90+
Mandatory = $false,
91+
HelpMessage = "Use alternative settings stored in session for AI preferences like Language, Image collections, etc"
92+
)]
93+
[switch] $SessionOnly,
94+
########################################################################
95+
[Parameter(
96+
Mandatory = $false,
97+
HelpMessage = "Clear alternative settings stored in session for AI preferences like Language, Image collections, etc"
98+
)]
99+
[switch] $ClearSession,
100+
########################################################################
101+
[Parameter(
102+
Mandatory = $false,
103+
HelpMessage = "Dont use alternative settings stored in session for AI preferences like Language, Image collections, etc"
104+
)]
105+
[Alias("FromPreferences")]
106+
[switch] $SkipSession
87107
########################################################################
88108
)
89109

0 commit comments

Comments
 (0)