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
fa3013b4
Commit
fa3013b4
authored
1 year ago
by
Yoann Schneider
Committed by
Mélodie Boillet
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove deepcopy when I can
parent
71d1406c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!174
Remove deepcopy when I can
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dan/manager/ocr.py
+1
-2
1 addition, 2 deletions
dan/manager/ocr.py
dan/manager/training.py
+2
-3
2 additions, 3 deletions
dan/manager/training.py
with
3 additions
and
5 deletions
dan/manager/ocr.py
+
1
−
2
View file @
fa3013b4
# -*- coding: utf-8 -*-
import
copy
import
os
import
pickle
...
...
@@ -62,7 +61,7 @@ class OCRDataset(GenericDataset):
self
.
collate_function
=
OCRCollateFunction
def
__getitem__
(
self
,
idx
):
sample
=
copy
.
deepcopy
(
self
.
samples
[
idx
])
sample
=
dict
(
**
self
.
samples
[
idx
])
if
not
self
.
load_in_memory
:
sample
[
"
img
"
]
=
self
.
get_sample_img
(
idx
)
...
...
This diff is collapsed.
Click to expand it.
dan/manager/training.py
+
2
−
3
View file @
fa3013b4
# -*- coding: utf-8 -*-
import
copy
import
json
import
os
import
random
from
copy
import
deepcopy
from
time
import
time
import
numpy
as
np
...
...
@@ -481,8 +481,7 @@ class GenericTrainingManager:
path
=
os
.
path
.
join
(
self
.
paths
[
"
results
"
],
"
params
"
)
if
os
.
path
.
isfile
(
path
):
return
params
=
copy
.
deepcopy
(
self
.
params
)
params
=
class_to_str_dict
(
params
)
params
=
class_to_str_dict
(
my_dict
=
deepcopy
(
self
.
params
))
total_params
=
0
for
model_name
in
self
.
models
.
keys
():
current_params
=
compute_nb_params
(
self
.
models
[
model_name
])
...
...
This diff is collapsed.
Click to expand it.
Yoann Schneider
@yschneider
mentioned in merge request
!224 (merged)
·
1 year ago
mentioned in merge request
!224 (merged)
mentioned in merge request !224
Toggle commit list
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