Commit ca73c96ffed6bf2f37a19c26f579a89e16be0c30
1 parent
10b4f63f
Exists in
master
and in
2 other branches
Transformed into independent module!!!
Showing
24 changed files
with
55 additions
and
50 deletions
Show diff stats
mdata/CV.py
1 | 1 | # -*- coding: utf-8 -*- |
2 | 2 | __author__ = 'chunk' |
3 | 3 | |
4 | -from mdata import * | |
5 | -from mfeat import HOG, IntraBlockDiff | |
6 | -from mspark import SC | |
4 | +from . import * | |
5 | +from ..mfeat import HOG, IntraBlockDiff | |
6 | +from ..mspark import SC | |
7 | +from ..common import * | |
7 | 8 | |
8 | 9 | import os, sys |
9 | 10 | from PIL import Image |
10 | 11 | from hashlib import md5 |
11 | 12 | import csv |
12 | 13 | import shutil |
13 | -from common import * | |
14 | 14 | import json |
15 | 15 | import collections |
16 | 16 | import happybase | ... | ... |
mdata/CV.pyc
No preview for this file type
mdata/MSR.py
1 | 1 | # -*- coding: utf-8 -*- |
2 | 2 | __author__ = 'chunk' |
3 | 3 | |
4 | -from mdata import * | |
5 | -from mfeat import HOG, IntraBlockDiff | |
6 | -from mspark import SC | |
4 | +from . import * | |
5 | +from ..mfeat import HOG, IntraBlockDiff | |
6 | +from ..mspark import SC | |
7 | +from ..common import * | |
7 | 8 | |
8 | 9 | import os, sys |
9 | 10 | import base64 |
... | ... | @@ -12,7 +13,6 @@ from io import BytesIO |
12 | 13 | from hashlib import md5 |
13 | 14 | import csv |
14 | 15 | import shutil |
15 | -from common import * | |
16 | 16 | import json |
17 | 17 | import collections |
18 | 18 | import itertools | ... | ... |
mdata/MSR.pyc
No preview for this file type
mfeat/HOG.py
mfeat/HOG.pyc
No preview for this file type
mfeat/IntraBlockDiff.py
1 | 1 | __author__ = 'chunk' |
2 | 2 | |
3 | -from mfeat import * | |
3 | +from . import * | |
4 | +from ..common import * | |
5 | +from ..mjpeg import * | |
6 | +from ..msteg import * | |
7 | +from ..msteg.steganalysis import MPB | |
4 | 8 | |
5 | -from common import * | |
6 | 9 | import numpy as np |
7 | 10 | |
8 | -from mjpeg import * | |
9 | -from msteg import * | |
10 | -from msteg.steganalysis import MPB | |
11 | - | |
12 | - | |
13 | 11 | class FeatIntraBlockDiff(FeatureBase): |
14 | 12 | def __init__(self): |
15 | 13 | FeatureBase.__init__(self) | ... | ... |
mfeat/IntraBlockDiff.pyc
No preview for this file type
mfeat/__init__.py
mfeat/__init__.pyc
No preview for this file type
mmodel/SVM.py
... | ... | @@ -5,12 +5,12 @@ SVM Model. |
5 | 5 | chunkplus@gmail.com |
6 | 6 | 2014 Dec |
7 | 7 | ''' |
8 | -from mfeat import * | |
9 | -from mmodel import * | |
10 | -from svmutil import * | |
11 | -from mspark import SC | |
8 | +from ..mfeat import * | |
9 | +from . import * | |
10 | +from .svmutil import * | |
11 | +from ..mspark import SC | |
12 | +from ..common import * | |
12 | 13 | |
13 | -from common import * | |
14 | 14 | import numpy as np |
15 | 15 | import csv |
16 | 16 | import json | ... | ... |
mmodel/SVM.pyc
No preview for this file type
mspark/SC.py
mspark/SC.pyc
No preview for this file type
msteg/__init__.py
... | ... | @@ -2,8 +2,8 @@ __author__ = 'chunk' |
2 | 2 | |
3 | 3 | import numpy as np |
4 | 4 | |
5 | -import mjpeg | |
6 | -from common import * | |
5 | +from ..mjpeg import Jpeg | |
6 | +from ..common import * | |
7 | 7 | |
8 | 8 | __all__ = ['StegBase', 'sample_key'] |
9 | 9 | |
... | ... | @@ -31,7 +31,7 @@ class StegBase(object): |
31 | 31 | """ |
32 | 32 | Returns DCT coefficients of the cover image. |
33 | 33 | """ |
34 | - self.cov_jpeg = mjpeg.Jpeg(img_path) | |
34 | + self.cov_jpeg = Jpeg(img_path) | |
35 | 35 | self.key = self.cov_jpeg.getkey() |
36 | 36 | self.cov_data = self.cov_jpeg.getCoefBlocks() |
37 | 37 | return self.cov_data | ... | ... |
msteg/__init__.pyc
No preview for this file type
msteg/steganalysis/ChiSquare.py
msteg/steganalysis/MPB.py
... | ... | @@ -6,9 +6,10 @@ Yun Q. Shi, et al - A Markov Process Based Approach to Effective Attacking JPEG |
6 | 6 | import time |
7 | 7 | import math |
8 | 8 | import numpy as np |
9 | -from msteg import * | |
10 | -import mjpeg | |
11 | -from common import * | |
9 | + | |
10 | +from .. import * | |
11 | +from ...mjpeg import Jpeg,colorMap | |
12 | +from ...common import * | |
12 | 13 | |
13 | 14 | import csv |
14 | 15 | import json |
... | ... | @@ -237,8 +238,8 @@ class MPB(StegBase): |
237 | 238 | with open('res/tmp.model', 'rb') as modelfile: |
238 | 239 | clf = pickle.load(modelfile) |
239 | 240 | |
240 | - im = mjpeg.Jpeg(image, key=sample_key) | |
241 | - ciq = im.coef_arrays[mjpeg.colorMap['Y']] | |
241 | + im = Jpeg(image, key=sample_key) | |
242 | + ciq = im.coef_arrays[colorMap['Y']] | |
242 | 243 | tpm = self.get_trans_prob_mat(ciq) |
243 | 244 | |
244 | 245 | return clf.predict(tpm) |
... | ... | @@ -268,8 +269,8 @@ class MPB(StegBase): |
268 | 269 | svm = cv2.SVM() |
269 | 270 | svm.load('res/svm_data.model') |
270 | 271 | |
271 | - im = mjpeg.Jpeg(image, key=sample_key) | |
272 | - ciq = im.coef_arrays[mjpeg.colorMap['Y']] | |
272 | + im = Jpeg(image, key=sample_key) | |
273 | + ciq = im.coef_arrays[colorMap['Y']] | |
273 | 274 | tpm = self.get_trans_prob_mat(ciq) |
274 | 275 | |
275 | 276 | return svm.predict(tpm) | ... | ... |
msteg/steganalysis/MPB.pyc
No preview for this file type
msteg/steganography/F3.py
msteg/steganography/F4-simple.py
msteg/steganography/F4.py
... | ... | @@ -2,9 +2,10 @@ __author__ = 'chunk' |
2 | 2 | |
3 | 3 | import numpy as np |
4 | 4 | import numpy.random as rnd |
5 | -from msteg import * | |
6 | -import mjpeg | |
7 | -from common import * | |
5 | + | |
6 | +from .. import * | |
7 | +from ...common import * | |
8 | +from ...mjpeg import Jpeg | |
8 | 9 | |
9 | 10 | |
10 | 11 | class F4(StegBase): |
... | ... | @@ -22,7 +23,7 @@ class F4(StegBase): |
22 | 23 | """ |
23 | 24 | Returns DCT coefficients of the cover image. |
24 | 25 | """ |
25 | - self.cov_jpeg = mjpeg.Jpeg(img_path, key=self.key) | |
26 | + self.cov_jpeg = Jpeg(img_path, key=self.key) | |
26 | 27 | |
27 | 28 | cov_data = self.cov_jpeg.getsignal(channel='Y') |
28 | 29 | self.cov_data = np.array(cov_data, dtype=np.int16) | ... | ... |
msteg/steganography/F5.py
... | ... | @@ -26,10 +26,11 @@ which embedding function (one of JSteg, F3, F4) should be used. |
26 | 26 | import math |
27 | 27 | import numpy as np |
28 | 28 | import numpy.random as rnd |
29 | -from msteg import * | |
30 | -from F4 import F4 | |
31 | -import mjpeg | |
32 | -from common import * | |
29 | + | |
30 | +from .. import * | |
31 | +from .F4 import F4 | |
32 | +from ...mjpeg import Jpeg | |
33 | +from ...common import * | |
33 | 34 | |
34 | 35 | |
35 | 36 | class F5(StegBase): |
... | ... | @@ -53,7 +54,7 @@ class F5(StegBase): |
53 | 54 | """ |
54 | 55 | Returns DCT coefficients of the cover image. |
55 | 56 | """ |
56 | - self.cov_jpeg = mjpeg.Jpeg(img_path, key=self.key) | |
57 | + self.cov_jpeg = Jpeg(img_path, key=self.key) | |
57 | 58 | |
58 | 59 | cov_data = self.cov_jpeg.getsignal(channel='Y') |
59 | 60 | self.cov_data = np.array(cov_data, dtype=np.int16) | ... | ... |