Skip to content

Commit

Permalink
init: layout single image execution controller
Browse files Browse the repository at this point in the history
Since we developing the single image execution codes, we should
proceed to layout its controller layer first. Hence, let's do this.

This patch layouts single image execution controller in init/
directory.

Co-authored-by: Shuralyov, Jean <jean.shuralyov@proton.me>
Co-authored-by: Galyna, Cory <cory.galyna@gmail.com>
Co-authored-by: (Holloway) Chew, Kean Ho <hollowaykeanho@gmail.com>
Signed-off-by: (Holloway) Chew, Kean Ho <hollowaykeanho@gmail.com>
  • Loading branch information
3 people committed Feb 10, 2024
1 parent b9130b3 commit ac2d971
Show file tree
Hide file tree
Showing 8 changed files with 434 additions and 16 deletions.
8 changes: 8 additions & 0 deletions init/services/compilers/upscaler.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,14 @@ function UPSCALER-Program-Get {



function UPSCALER-Run-Image {
# report status
return 0
}




function UPSCALER-Scale-Get {
param(
[string]$___limit,
Expand Down
8 changes: 8 additions & 0 deletions init/services/compilers/upscaler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,14 @@ UPSCALER_Program_Get() {



UPSCALER_Run_Image() {
# report status
return 0
}




UPSCALER_Scale_Get() {
#___limit="$1"
#___input="$2"
Expand Down
109 changes: 109 additions & 0 deletions init/services/i18n/report-info.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# BSD 3-Clause License
#
# Copyright (c) 2024 (Holloway) Chew, Kean Ho
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
. "${env:LIBS_UPSCALER}\services\i18n\__printer.ps1"




function I18N-Report-Info {
param(
[string]$___batch,
[string]$___video,
[string]$___model,
[string]$___scale,
[string]$___format,
[string]$___parallel,
[string]$___gpu,
[string]$___input,
[string]$___output
)

# execute
switch (${env:UPSCALER_LANG}) {
{ $_ -in "DE", "de" } {
# german
if ($___batch -eq 1) {
$___batch_job = "ja"
} else {
$___batch_job = "nein"
}

if ($___video -eq 1) {
$___video_job = "ja"
} else {
$___video_job = "nein"
}

$null = I18N-Status-Print "info" @"
Stapelverarbeitung : ${___batch_job}
Videoaufgabe : ${___video_job}
Modell : ${___model}
Skalierungsfaktor : ${___scale}
Ausgewähltes Format : ${___format}
Parallelität : ${___parallel}
Ausgewählte GPU : ${___gpu}
Bereitgestellter Input : ${___input}
Ausgabe-Speicherort : ${___output}
"@
} default {
# fallback to default english
if ($___batch -eq 1) {
$___batch_job = "yes"
} else {
$___batch_job = "no"
}

if ($___video -eq 1) {
$___video_job = "yes"
} else {
$___video_job = "no"
}

$null = I18N-Status-Print "info" @"
Batch Job : ${___batch_job}
Video Job : ${___video_job}
Model : ${___model}
Scaling Factor : ${___scale}
Selected Format : ${___format}
Parallelism : ${___parallel}
Selected GPU : ${___gpu}
Provided Input : ${___input}
Output Location : ${___output}
"@
}}


# report status
return 0
}
108 changes: 108 additions & 0 deletions init/services/i18n/report-info.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# BSD 3-Clause License
#
# Copyright (c) 2024 (Holloway) Chew, Kean Ho
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
. "${LIBS_UPSCALER}/services/i18n/__printer.sh"




I18N_Report_Info() {
#___batch="$1"
#___video="$2"
#___model="$3"
#___scale="$4"
#___format="$5"
#___parallel="$6"
#___gpu="$7"
#___input="$8"
#___output="$9"


# execute
case "$UPSCALER_LANG" in
DE|de)
# German
if [ "$1" = "1" ]; then
___batch_job="ja"
else
___batch_job="nein"
fi

if [ "$2" = "1" ]; then
___video_job="ja"
else
___video_job="nein"
fi

I18N_Status_Print "info" "
Stapelverarbeitung : ${___batch_job}
Videoaufgabe : ${___video_job}
Modell : ${3}
Skalierungsfaktor : ${4}
Ausgewähltes Format : ${5}
Parallelität : ${6}
Ausgewählte GPU : ${7}
Bereitgestellter Input : ${8}
Ausgabe-Speicherort : ${9}
"
;;
*)
# fallback to default english
if [ "$1" = "1" ]; then
___batch_job="yes"
else
___batch_job="no"
fi

if [ "$2" = "1" ]; then
___video_job="yes"
else
___video_job="no"
fi

I18N_Status_Print "info" "
Batch Job : ${___batch_job}
Video Job : ${___video_job}
Model : ${3}
Scaling Factor : ${4}
Selected Format : ${5}
Parallelism : ${6}
Selected GPU : ${7}
Provided Input : ${8}
Output Location : ${9}
"
;;
esac


# report status
return 0
}
49 changes: 49 additions & 0 deletions init/services/i18n/report-success.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# BSD 3-Clause License
#
# Copyright (c) 2024 (Holloway) Chew, Kean Ho
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
. "${env:LIBS_UPSCALER}\services\i18n\__printer.ps1"




function I18N-Report-Success {
# execute
switch (${env:UPSCALER_LANG}) {
{ $_ -in "DE", "de" } {
# german
$null = I18N-Status-Print "success" "Hochskaliert abgeschlossen.`n"
} default {
# fallback to default english
$null = I18N-Status-Print "success" "Upscaled completed.`n"
}}


# report status
return 0
}
51 changes: 51 additions & 0 deletions init/services/i18n/report-success.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# BSD 3-Clause License
#
# Copyright (c) 2024 (Holloway) Chew, Kean Ho
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
. "${LIBS_UPSCALER}/services/i18n/__printer.sh"




I18N_Report_Success() {
# execute
case "$UPSCALER_LANG" in
DE|de)
# German
I18N_Status_Print "sucesss" "Hochskaliert abgeschlossen.\n"
;;
*)
# fallback to default english
I18N_Status_Print "success" "Upscaled completed.\n"
;;
esac


# report status
return 0
}

0 comments on commit ac2d971

Please sign in to comment.