Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
skais
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Raphael Sturgis
skais
Merge requests
!10
Resolve "Image creation bugs with 0 size windows"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Resolve "Image creation bugs with 0 size windows"
21-image-creation-bugs-with-0-size-windows
into
main
Overview
0
Commits
27
Pipelines
0
Changes
3
Closed
Raphael Sturgis
requested to merge
21-image-creation-bugs-with-0-size-windows
into
main
3 years ago
Overview
0
Commits
27
Pipelines
0
Changes
3
Expand
Closes
#21 (closed)
0
0
Merge request reports
Viewing commit
5e01b527
Prev
Next
Show latest version
3 files
+
129
−
12
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
5e01b527
improvements to test engine + tests
· 5e01b527
Raphael
authored
3 years ago
skais/process/data_augmentation/augmentation_engine.py
+
16
−
10
Options
import
tqdm
as
tqdm
import
tqdm
as
tqdm
from
skais.process.data_augmentation.data_transformer
import
DataTransformer
from
skais.process.data_augmentation.flip
import
Flip
from
skais.process.data_augmentation.flip
import
Flip
from
skais.process.data_augmentation.pipeline
import
Pipeline
from
skais.process.data_augmentation.pipeline
import
Pipeline
from
skais.process.data_augmentation.translator
import
Translator
from
skais.process.data_augmentation.translator
import
Translator
class
AugmentationEngine
:
class
AugmentationEngine
:
def
__init__
(
self
,
translation_values
,
flip_values
):
def
__init__
(
self
,
translation_values
=
None
,
flip_values
=
None
,
keep_original
=
True
):
self
.
pipelines
=
[]
self
.
pipelines
=
[]
if
keep_original
:
self
.
pipelines
.
append
(
DataTransformer
())
for
tv_long
,
tv_lat
in
translation_values
:
if
translation_values
is
not
None
:
self
.
pipelines
.
append
(
Pipeline
([
Translator
(
tv_long
,
tv_lat
)]))
for
tv_long
,
tv_lat
in
translation_values
:
self
.
pipelines
.
append
(
Pipeline
([
Translator
(
tv_long
,
tv_lat
)]))
for
fv_meridian
,
fv_parallel
in
flip_values
:
if
flip_values
is
not
None
:
self
.
pipelines
.
append
(
Pipeline
([
Flip
(
fv_meridian
,
fv_parallel
)]))
for
tv_long
,
tv_lat
in
translation_values
:
translator
=
Translator
(
tv_long
,
tv_lat
)
for
fv_meridian
,
fv_parallel
in
flip_values
:
for
fv_meridian
,
fv_parallel
in
flip_values
:
flip
=
Flip
(
fv_meridian
,
fv_parallel
)
self
.
pipelines
.
append
(
Pipeline
([
Flip
(
fv_meridian
,
fv_parallel
)]))
self
.
pipelines
.
append
(
Pipeline
([
translator
,
flip
]))
if
flip_values
is
not
None
and
translation_values
is
not
None
:
for
tv_long
,
tv_lat
in
translation_values
:
translator
=
Translator
(
tv_long
,
tv_lat
)
for
fv_meridian
,
fv_parallel
in
flip_values
:
flip
=
Flip
(
fv_meridian
,
fv_parallel
)
self
.
pipelines
.
append
(
Pipeline
([
translator
,
flip
]))
def
transform
(
self
,
x
,
verbose
=
0
):
def
transform
(
self
,
x
,
verbose
=
0
):
results
=
x
.
copy
()
results
=
x
.
copy
()
Loading