Skip to content
Snippets Groups Projects
Commit 3ed5ce74 authored by Levecque Etienne's avatar Levecque Etienne
Browse files

data planning

parent 6aa8e069
No related branches found
No related tags found
No related merge requests found
data.py 0 → 100644
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
main.py 0 → 100644
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))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment