Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Toward Reliable JPEG Stega qf100 WIFS2022
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
Releases
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
Toward Reliable JPEG Stega qf100 WIFS2022
Commits
3ed5ce74
Commit
3ed5ce74
authored
2 years ago
by
Levecque Etienne
Browse files
Options
Downloads
Patches
Plain Diff
data planning
parent
6aa8e069
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
data.py
+41
-0
41 additions, 0 deletions
data.py
main.py
+22
-0
22 additions, 0 deletions
main.py
with
63 additions
and
0 deletions
data.py
0 → 100644
+
41
−
0
View file @
3ed5ce74
def
get_train_test_generator
(
dir_path
,
train_size
,
stego_percentage
):
"""
Return two generators. One for the train cover images, the second for the test cover images and a third for the
test stego images
:param dir_path: images directory path
:param train_size: percentage of the training set size
:param stego_percentage: percentage of the stego images among the test images
:return: three generators.
"""
pass
def
embed_images
(
img_generator
,
payload
):
"""
Embed random messages into images with J-UNIWARD
:param img_generator: image generator
:param payload: payload of the message in bpnzac
:return: a generator of stego images
"""
pass
def
variance_filter
(
img_generator
,
variance_threshold
,
block_per_threshold
):
"""
Filter images based on the variance of each block. If a block does not have enough variance, it is discarded. The
whole image is discarded if too many blocks are discarded
:param img_generator: image generator
:param variance_threshold: block with a variance below this threshold are discarded
:param block_per_threshold: image with a percentage of accepted blocks below this threshold are discarded
:return: a generator of blocks
"""
pass
def
feature_extractor
(
block_generator
):
"""
Extract the spatial rounding error from views
:param block_generator: a generator of list of blocks. One list for one image
:return: a generator of views
"""
pass
This diff is collapsed.
Click to expand it.
main.py
0 → 100644
+
22
−
0
View file @
3ed5ce74
from
data
import
get_train_test_generator
,
embed_images
,
variance_filter
,
feature_extractor
dir_path
=
""
train_size
=
0.0
payload
=
0.0
stego_percentage
=
0.0
variance_threshold
=
0.0
block_per_threshold
=
0.0
if
__name__
==
"
__main__
"
:
train_gen
,
test_cover_gen
,
test_stego_gen
=
get_train_test_generator
(
dir_path
,
train_size
,
stego_percentage
)
train_features
=
feature_extractor
(
variance_filter
(
train_gen
,
variance_threshold
,
block_per_threshold
))
test_cover_features
=
feature_extractor
(
variance_filter
(
test_cover_gen
,
variance_threshold
,
block_per_threshold
))
test_stego_features
=
feature_extractor
(
variance_filter
(
embed_images
(
test_stego_gen
,
payload
),
variance_threshold
,
block_per_threshold
))
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