Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DAN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Automatic Text Recognition
DAN
Commits
454b992e
Commit
454b992e
authored
1 year ago
by
Mélodie
Browse files
Options
Downloads
Patches
Plain Diff
Remove DPIAdjusting preprocessing
parent
aa3daa82
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dan/manager/dataset.py
+0
-13
0 additions, 13 deletions
dan/manager/dataset.py
docs/usage/train/parameters.md
+0
-8
0 additions, 8 deletions
docs/usage/train/parameters.md
with
0 additions
and
21 deletions
dan/manager/dataset.py
+
0
−
13
View file @
454b992e
...
...
@@ -347,19 +347,6 @@ def apply_preprocessing(sample, preprocessings):
resize_ratio
=
[
1
,
1
]
img
=
sample
[
"
img
"
]
for
preprocessing
in
preprocessings
:
if
preprocessing
[
"
type
"
]
==
"
dpi
"
:
ratio
=
preprocessing
[
"
target
"
]
/
preprocessing
[
"
source
"
]
temp_img
=
img
h
,
w
,
c
=
temp_img
.
shape
temp_img
=
cv2
.
resize
(
temp_img
,
(
int
(
np
.
ceil
(
w
*
ratio
)),
int
(
np
.
ceil
(
h
*
ratio
)))
)
if
len
(
temp_img
.
shape
)
==
2
:
temp_img
=
np
.
expand_dims
(
temp_img
,
axis
=
2
)
img
=
temp_img
resize_ratio
=
[
ratio
,
ratio
]
if
preprocessing
[
"
type
"
]
==
"
to_grayscaled
"
:
temp_img
=
img
h
,
w
,
c
=
temp_img
.
shape
...
...
This diff is collapsed.
Click to expand it.
docs/usage/train/parameters.md
+
0
−
8
View file @
454b992e
...
...
@@ -23,14 +23,6 @@ All hyperparameters are specified and editable in the training scripts (meaning
Preprocessing is applied before training the network (see
`dan/manager/dataset.py`
).
The following transformations are implemented:
*
DPI adjustment
```
py
{
"
type
"
:
"
dpi
"
,
"
source
"
:
300
,
"
target
"
:
150
,
}
```
*
Convert to grayscale
```
py
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment