Skip to content

Commit 4d9c218

Browse files
committed
Release 1.212.2025
1 parent ab745e6 commit 4d9c218

88 files changed

Lines changed: 17131 additions & 11873 deletions

File tree

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/Compare-ImageFaces.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
###############################################################################
1+
###############################################################################
22
<#
33
.SYNOPSIS
44
Compares faces in two different images and returns their similarity using
@@ -205,7 +205,7 @@ function Compare-ImageFaces {
205205
-ErrorAction SilentlyContinue)
206206

207207
# initialize deepstack docker container if needed
208-
$null = EnsureDeepStack @ensureParams
208+
$null = GenXdev.AI\EnsureDeepStack @ensureParams
209209
}
210210
else {
211211

@@ -317,8 +317,8 @@ function Compare-ImageFaces {
317317

318318
# create form data for deepstack api (it expects multipart form data)
319319
$form = @{
320-
image1 = Microsoft.PowerShell.Management\Get-Item $imagePath1
321-
image2 = Microsoft.PowerShell.Management\Get-Item $imagePath2
320+
image1 = Microsoft.PowerShell.Management\Get-Item -LiteralPath $imagePath1
321+
image2 = Microsoft.PowerShell.Management\Get-Item -LiteralPath $imagePath2
322322
}
323323

324324
# send the request to the deepstack face match api

Functions/GenXdev.AI.DeepStack/Get-ImageDetectedFaces.ps1

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
###############################################################################
1+
###############################################################################
22
<#
33
.SYNOPSIS
44
Recognizes faces in an uploaded image by comparing to known faces using
@@ -205,7 +205,7 @@ function Get-ImageDetectedFaces {
205205
-ErrorAction SilentlyContinue)
206206

207207
# initialize deepstack docker container if needed
208-
$null = EnsureDeepStack @ensureParams
208+
$null = GenXdev.AI\EnsureDeepStack @ensureParams
209209
} else {
210210
Microsoft.PowerShell.Utility\Write-Verbose `
211211
'Skipping Docker initialization as requested' }
@@ -232,6 +232,16 @@ function Get-ImageDetectedFaces {
232232

233233
Microsoft.PowerShell.Utility\Write-Verbose "Sending request to: $uri"
234234

235+
# Validate image file exists before processing
236+
if (-not [System.IO.File]::Exists($imagePath)) {
237+
Microsoft.PowerShell.Utility\Write-Warning "Image file not found: $imagePath"
238+
return @{
239+
success = $false
240+
error = "No valid image file found"
241+
duration = 0
242+
} | Microsoft.PowerShell.Utility\ConvertTo-Json
243+
}
244+
235245
# create form data for DeepStack API (it expects multipart form
236246
# data, not JSON)
237247
$form = @{
@@ -268,18 +278,27 @@ function Get-ImageDetectedFaces {
268278
Microsoft.PowerShell.Utility\Write-Output $response
269279
}
270280
catch [System.Net.WebException] {
271-
Microsoft.PowerShell.Utility\Write-Error `
281+
Microsoft.PowerShell.Utility\Write-Warning `
272282
('Network error while contacting DeepStack face recognition ' +
273283
"service: $_")
274284
}
275285
catch [System.TimeoutException] {
276-
Microsoft.PowerShell.Utility\Write-Error `
286+
Microsoft.PowerShell.Utility\Write-Warning `
277287
('Timeout while waiting for DeepStack face recognition ' +
278288
"response: $_")
279289
}
280290
catch {
281-
Microsoft.PowerShell.Utility\Write-Error `
282-
"Failed to recognize faces: $_"
291+
# Check if this is a file access issue vs actual processing failure
292+
if ($_.Exception.Message -like "*Could not find item*" -or
293+
$_.Exception.Message -like "*No valid image file found*") {
294+
295+
Microsoft.PowerShell.Utility\Write-Verbose `
296+
"Face detection skipped - file not accessible: $imagePath"
297+
}
298+
else {
299+
Microsoft.PowerShell.Utility\Write-Warning `
300+
"Face detection failed for $imagePath`: $($_.Exception.Message)"
301+
}
283302
}
284303
}
285304

Functions/GenXdev.AI.DeepStack/Get-ImageDetectedObjects.ps1

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
###############################################################################
1+
###############################################################################
22
<#
33
.SYNOPSIS
44
Detects and classifies objects in an uploaded image using DeepStack.
@@ -234,7 +234,7 @@ function Get-ImageDetectedObjects {
234234
)
235235

236236
# initialize deepstack docker container if needed
237-
$null = EnsureDeepStack @ensureParams
237+
$null = GenXdev.AI\EnsureDeepStack @ensureParams
238238
}
239239
else {
240240

@@ -352,6 +352,16 @@ function Get-ImageDetectedObjects {
352352
"Sending request to: $uri"
353353

354354
# create form data for deepstack api
355+
# Validate image file exists before processing
356+
if (-not [System.IO.File]::Exists($imagePath)) {
357+
Microsoft.PowerShell.Utility\Write-Warning "Image file not found: $imagePath"
358+
return @{
359+
success = $false
360+
error = "No valid image file found"
361+
duration = 0
362+
} | Microsoft.PowerShell.Utility\ConvertTo-Json
363+
}
364+
355365
# the 'min_confidence' parameter expects a value between 0.0 and 1.0
356366
$form = @{
357367
image = Microsoft.PowerShell.Management\Get-Item $imagePath
@@ -383,17 +393,17 @@ function Get-ImageDetectedObjects {
383393
}
384394
catch [System.Net.WebException] {
385395

386-
Microsoft.PowerShell.Utility\Write-Error `
396+
Microsoft.PowerShell.Utility\Write-Warning `
387397
"Network error during object detection: $_"
388398
}
389399
catch [System.TimeoutException] {
390400

391-
Microsoft.PowerShell.Utility\Write-Error `
401+
Microsoft.PowerShell.Utility\Write-Warning `
392402
"Timeout during object detection for $imagePath"
393403
}
394404
catch {
395405

396-
Microsoft.PowerShell.Utility\Write-Error `
406+
Microsoft.PowerShell.Utility\Write-Warning `
397407
"Failed to detect objects in $imagePath`: $_"
398408
}
399409
}

Functions/GenXdev.AI.DeepStack/Get-ImageDetectedScenes.ps1

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
###############################################################################
1+
###############################################################################
22
<#
33
.SYNOPSIS
44
Classifies an image into one of 365 scene categories using DeepStack.
@@ -259,7 +259,7 @@ function Get-ImageDetectedScenes {
259259
-ErrorAction SilentlyContinue)
260260

261261
# initialize deepstack docker container if needed
262-
$null = EnsureDeepStack @ensureParams
262+
$null = GenXdev.AI\EnsureDeepStack @ensureParams
263263

264264
} else {
265265

@@ -365,6 +365,16 @@ function Get-ImageDetectedScenes {
365365

366366
Microsoft.PowerShell.Utility\Write-Verbose "Sending request to: $uri"
367367

368+
# Validate image file exists before processing
369+
if (-not [System.IO.File]::Exists($imagePath)) {
370+
Microsoft.PowerShell.Utility\Write-Warning "Image file not found: $imagePath"
371+
return @{
372+
success = $false
373+
error = "No valid image file found"
374+
duration = 0
375+
} | Microsoft.PowerShell.Utility\ConvertTo-Json
376+
}
377+
368378
# create form data for deepstack api (it expects multipart form data)
369379
$form = @{
370380
image = Microsoft.PowerShell.Management\Get-Item $imagePath
@@ -394,18 +404,26 @@ function Get-ImageDetectedScenes {
394404
}
395405
catch [System.Net.WebException] {
396406

397-
Microsoft.PowerShell.Utility\Write-Error `
407+
Microsoft.PowerShell.Utility\Write-Warning `
398408
"Network error during scene recognition: $_"
399409
}
400410
catch [System.TimeoutException] {
401411

402-
Microsoft.PowerShell.Utility\Write-Error `
412+
Microsoft.PowerShell.Utility\Write-Warning `
403413
"Timeout during scene recognition for $imagePath"
404414
}
405415
catch {
416+
# Check if this is a file access issue vs actual processing failure
417+
if ($_.Exception.Message -like "*Could not find item*" -or
418+
$_.Exception.Message -like "*No valid image file found*") {
406419

407-
Microsoft.PowerShell.Utility\Write-Error `
408-
"Failed to recognize scene in $imagePath`: $_"
420+
Microsoft.PowerShell.Utility\Write-Verbose `
421+
"Scene detection skipped - file not accessible: $imagePath"
422+
}
423+
else {
424+
Microsoft.PowerShell.Utility\Write-Warning `
425+
"Scene detection failed for $imagePath`: $($_.Exception.Message)"
426+
}
409427
}
410428
}
411429

Functions/GenXdev.AI.DeepStack/Get-RegisteredFaces.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
###############################################################################
1+
###############################################################################
22
<#
33
.SYNOPSIS
44
Retrieves a list of all registered face identifiers from DeepStack.
@@ -169,7 +169,7 @@ function Get-RegisteredFaces {
169169
-ErrorAction SilentlyContinue)
170170

171171
# initialize deepstack service with provided parameters
172-
$null = EnsureDeepStack @ensureParams
172+
$null = GenXdev.AI\EnsureDeepStack @ensureParams
173173

174174
} else {
175175

Functions/GenXdev.AI.DeepStack/Invoke-ImageEnhancement.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
###############################################################################
1+
###############################################################################
22
<#
33
.SYNOPSIS
44
Enhances an image by enlarging it 4X while improving quality using DeepStack.
@@ -205,7 +205,7 @@ function Invoke-ImageEnhancement {
205205
-ErrorAction SilentlyContinue)
206206

207207
# initialize deepstack docker container if needed
208-
$null = EnsureDeepStack @ensureParams
208+
$null = GenXdev.AI\EnsureDeepStack @ensureParams
209209
}
210210
else {
211211

Functions/GenXdev.AI.DeepStack/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Find-IndexedImage -HasNudity -HasExplicitContent -ShowInBrowser -InterActive
6868
# you can keep the output and reuse them
6969
$foundImages = Find-IndexedImage -HasNudity -HasExplicitContent
7070
71-
# all Find-IndexedImage's parameters, except -PathsLike, are inclusive
71+
# all Find-IndexedImage's parameters, except -PathLike, are inclusive
7272
# to truly filter using exclusions, chain commands using pipes |
7373
Set-WindowsPosition -Monitor 0 -Left
7474

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
###############################################################################
1+
###############################################################################
22
<#
33
.SYNOPSIS
44
Updates all face recognition profiles from image files in the faces directory.
@@ -210,7 +210,7 @@ function Register-AllFaces {
210210
-DefaultValues (Microsoft.PowerShell.Utility\Get-Variable `
211211
-Scope Local `
212212
-ErrorAction SilentlyContinue)
213-
$FacesDirectory = Get-AIKnownFacesRootpath @params
213+
$FacesDirectory = GenXdev.AI\Get-AIKnownFacesRootpath @params
214214

215215
Microsoft.PowerShell.Utility\Write-Verbose `
216216
"Using provided faces directory: $FacesDirectory"
@@ -285,7 +285,7 @@ function Register-AllFaces {
285285
}
286286

287287
# ensure deepstack service is running
288-
$null = EnsureDeepStack @ensureParams
288+
$null = GenXdev.AI\EnsureDeepStack @ensureParams
289289

290290
# verify service is responding by performing health check
291291
$null = Microsoft.PowerShell.Utility\Invoke-RestMethod `
@@ -381,7 +381,7 @@ function Register-AllFaces {
381381
$registerParams.Identifier = $Identifier
382382

383383
# register the face using the deepstack service
384-
$null = Register-Face @registerParams `
384+
$null = GenXdev.AI\Register-Face @registerParams `
385385
-NoDockerInitialize -ErrorAction Stop
386386

387387
# add delay between successful registrations to prevent service overload
@@ -530,7 +530,7 @@ function Register-AllFaces {
530530
if (-not $ForceUpdate) {
531531

532532
# get list of existing registered faces
533-
$existingFaces = Get-RegisteredFaces `
533+
$existingFaces = GenXdev.AI\Get-RegisteredFaces `
534534
-NoDockerInitialize `
535535
-ErrorAction SilentlyContinue
536536

@@ -608,7 +608,7 @@ function Register-AllFaces {
608608
-ErrorAction SilentlyContinue)
609609

610610
# unregister all existing faces
611-
$null = Unregister-AllFaces @unregisterParams
611+
$null = GenXdev.AI\Unregister-AllFaces @unregisterParams
612612

613613
# pause to allow service to process the clearing operation
614614
Microsoft.PowerShell.Utility\Start-Sleep -Seconds 5

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
###############################################################################
1+
###############################################################################
22
<#
33
.SYNOPSIS
44
Registers a new face with the DeepStack face recognition API.
@@ -173,7 +173,7 @@ function Register-Face {
173173
-ErrorAction SilentlyContinue)
174174

175175
# initialize deepstack service with matching parameters
176-
$null = EnsureDeepStack @ensureParams
176+
$null = GenXdev.AI\EnsureDeepStack @ensureParams
177177
} else {
178178

179179
# log that docker initialization was skipped

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
###############################################################################
1+
###############################################################################
22
<#
33
.SYNOPSIS
44
Removes all registered faces from the DeepStack face recognition system.
@@ -192,7 +192,7 @@ function Unregister-AllFaces {
192192
}
193193

194194
# ensure deepstack service is running and accessible
195-
$null = EnsureDeepStack @ensureParams
195+
$null = GenXdev.AI\EnsureDeepStack @ensureParams
196196
}
197197
else {
198198

@@ -238,7 +238,7 @@ function Unregister-AllFaces {
238238
)
239239

240240
# invoke the rest api to get registered faces using post method
241-
$response = Microsoft.PowerShell.Utility\Invoke-RestMethod `
241+
$null = Microsoft.PowerShell.Utility\Invoke-RestMethod `
242242
-Uri $uri `
243243
-Method Post `
244244
-ContentType 'application/json' `
@@ -549,7 +549,7 @@ function Unregister-AllFaces {
549549
try {
550550

551551
# get list of remaining registered faces
552-
$remainingFaces = Get-RegisteredFaces `
552+
$remainingFaces = GenXdev.AI\Get-RegisteredFaces `
553553
-NoDockerInitialize `
554554
-ErrorAction SilentlyContinue
555555

0 commit comments

Comments
 (0)