Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
EVC
Ufv1 0
Commits
0d459ba8
Commit
0d459ba8
authored
Nov 23, 2025
by
valentini
Browse files
Carica un nuovo file
parent
98c3e774
Changes
1
Hide whitespace changes
Inline
Side-by-side
Reference Software/UFV1.0-Training/src/settings.py
0 → 100644
View file @
0d459ba8
import
yaml
class
Settings
:
def
__init__
(
self
,
d
,
config
):
self
.
low_sr_dir
=
d
[
'low_sr_dir'
]
self
.
high_sr_dir
=
d
[
'high_sr_dir'
]
self
.
width
=
d
[
'width'
]
self
.
height
=
d
[
'height'
]
self
.
pix_fmt
=
d
.
get
(
'pix_fmt'
,
'yuv420p'
)
self
.
range
=
d
.
get
(
'model_range'
,
1
)
self
.
luminance_only
=
d
.
get
(
'luminance_only'
,
False
)
self
.
clone_luminance_as_rgb
=
d
.
get
(
'clone_luminance_as_rgb'
,
False
)
self
.
upsample_uv
=
d
.
get
(
'upsample_uv'
,
False
)
self
.
uv_interpolation
=
d
.
get
(
'uv_interpolation'
,
'nearest'
)
self
.
scaling
=
config
.
get
(
'scaling'
,
2
)
self
.
batch_size
=
d
.
get
(
'batch_size'
,
4
)
self
.
patch_size
=
d
.
get
(
'patch_size'
,
None
)
# Scheduler settings
scheduler_cfg
=
config
.
get
(
'scheduler'
,
{})
self
.
use_plateau_scheduler
=
scheduler_cfg
.
get
(
'use_plateau_scheduler'
,
False
)
self
.
lr_step_size
=
scheduler_cfg
.
get
(
'lr_step_size'
,
10
)
self
.
lr_gamma
=
scheduler_cfg
.
get
(
'lr_gamma'
,
0.5
)
def
load_settings
(
config_path
):
with
open
(
config_path
,
'r'
)
as
f
:
config
=
yaml
.
safe_load
(
f
)
dataset_cfg
=
config
[
'dataset'
]
settings
=
Settings
(
dataset_cfg
,
config
)
return
settings
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment