Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Finding Incompatible JPEG Blocks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Levecque Etienne
Finding Incompatible JPEG Blocks
Commits
e1410571
Commit
e1410571
authored
1 year ago
by
Levecque Etienne
Browse files
Options
Downloads
Patches
Plain Diff
feat: use the config seed for the search
parent
6c3d5324
Loading
Loading
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
antecedent/image.py
+4
-4
4 additions, 4 deletions
antecedent/image.py
antecedent/run_on_dataset.py
+1
-1
1 addition, 1 deletion
antecedent/run_on_dataset.py
with
5 additions
and
5 deletions
antecedent/image.py
+
4
−
4
View file @
e1410571
...
...
@@ -84,7 +84,7 @@ class Image:
if
self
.
rng
is
None
:
self
.
rng
=
np
.
random
.
RandomState
()
def
search_antecedent
(
self
,
max_iter
,
shared_dict
=
None
,
task_id
=
None
,
verbose
=
False
):
def
search_antecedent
(
self
,
max_iter
,
shared_dict
=
None
,
task_id
=
None
,
verbose
=
False
,
rng
=
None
):
self
.
filter_blocks
()
if
self
.
pipeline
.
n
==
1
and
self
.
is_jpeg
and
not
self
.
is_grayscale
:
...
...
@@ -96,7 +96,7 @@ class Image:
for
i
,
block
in
enumerate
(
blocks
):
self
.
update_shared_dict
(
shared_dict
,
task_id
,
i
,
n
)
if
self
.
pipeline
not
in
block
.
status
:
block
.
search_antecedent
(
self
.
pipeline
,
max_iter
,
shared_dict
,
task_id
,
verbose
)
block
.
search_antecedent
(
self
.
pipeline
,
max_iter
,
shared_dict
,
task_id
,
verbose
,
rng
)
def
update_shared_dict
(
self
,
shared_dict
,
task_id
,
i
,
n
,
completed
=
0
,
total
=
0
):
if
shared_dict
is
not
None
and
task_id
is
not
None
:
...
...
@@ -106,7 +106,7 @@ class Image:
"
completed
"
:
completed
,
"
total
"
:
total
}
def
search_antecedent_independent_channel
(
self
,
max_iter
,
shared_dict
=
None
,
task_id
=
None
,
verbose
=
False
):
def
search_antecedent_independent_channel
(
self
,
max_iter
,
shared_dict
=
None
,
task_id
=
None
,
verbose
=
False
,
rng
=
None
):
names
=
[
pipe
.
name
for
pipe
in
self
.
pipeline
]
qualities
=
[
pipe
.
quality
for
pipe
in
self
.
pipeline
]
grayscale_pipeline
=
create_pipeline
(
names
,
qualities
,
grayscale
=
True
,
target_is_dct
=
True
)
...
...
@@ -126,7 +126,7 @@ class Image:
iterations
.
append
(
0
)
continue
antecedent
=
block
.
search_antecedent
(
grayscale_pipeline
,
max_iter
,
shared_dict
,
task_id
,
verbose
)
antecedent
=
block
.
search_antecedent
(
grayscale_pipeline
,
max_iter
,
shared_dict
,
task_id
,
verbose
,
rng
)
iteration
=
block
.
iterations
[
grayscale_pipeline
]
if
antecedent
is
None
:
antecedent
=
-
np
.
ones
((
1
,
8
,
8
))
...
...
This diff is collapsed.
Click to expand it.
antecedent/run_on_dataset.py
+
1
−
1
View file @
e1410571
...
...
@@ -101,7 +101,7 @@ def handle_image(filename, config, shared_dict, task_id, verbose):
img
.
search_antecedent
(
max_iter_heuristic
,
shared_dict
,
task_id
,
verbose
,
rng
)
if
search_config
[
'
gurobi_solver
'
][
'
use
'
]:
img
.
search_antecedent_ilp
(
search_config
[
'
gurobi_solver
'
],
shared_dict
,
task_id
,
verbose
,
rng
)
img
.
search_antecedent_ilp
(
search_config
[
'
gurobi_solver
'
],
shared_dict
,
task_id
,
verbose
)
return
img
...
...
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