diff --git a/mdata/CV.py b/mdata/CV.py index 0c5d945..05e6bcd 100644 --- a/mdata/CV.py +++ b/mdata/CV.py @@ -1,16 +1,16 @@ # -*- coding: utf-8 -*- __author__ = 'chunk' -from mdata import * -from mfeat import HOG, IntraBlockDiff -from mspark import SC +from . import * +from ..mfeat import HOG, IntraBlockDiff +from ..mspark import SC +from ..common import * import os, sys from PIL import Image from hashlib import md5 import csv import shutil -from common import * import json import collections import happybase diff --git a/mdata/CV.pyc b/mdata/CV.pyc index 8ec19ca..72e2b33 100644 Binary files a/mdata/CV.pyc and b/mdata/CV.pyc differ diff --git a/mdata/MSR.py b/mdata/MSR.py index cb788af..ca1bbbb 100644 --- a/mdata/MSR.py +++ b/mdata/MSR.py @@ -1,9 +1,10 @@ # -*- coding: utf-8 -*- __author__ = 'chunk' -from mdata import * -from mfeat import HOG, IntraBlockDiff -from mspark import SC +from . import * +from ..mfeat import HOG, IntraBlockDiff +from ..mspark import SC +from ..common import * import os, sys import base64 @@ -12,7 +13,6 @@ from io import BytesIO from hashlib import md5 import csv import shutil -from common import * import json import collections import itertools diff --git a/mdata/MSR.pyc b/mdata/MSR.pyc index 3a1316d..ea21d56 100644 Binary files a/mdata/MSR.pyc and b/mdata/MSR.pyc differ diff --git a/mfeat/HOG.py b/mfeat/HOG.py index d19346d..bc77a31 100644 --- a/mfeat/HOG.py +++ b/mfeat/HOG.py @@ -7,9 +7,9 @@ chunkplus@gmail.com """ __author__ = 'hadoop' -from mfeat import * +from . import * +from ..common import * -from common import * import numpy as np from PIL import Image import cv2 diff --git a/mfeat/HOG.pyc b/mfeat/HOG.pyc index a416a55..d4bbf73 100644 Binary files a/mfeat/HOG.pyc and b/mfeat/HOG.pyc differ diff --git a/mfeat/IntraBlockDiff.py b/mfeat/IntraBlockDiff.py index ae9d2d6..0f091d3 100644 --- a/mfeat/IntraBlockDiff.py +++ b/mfeat/IntraBlockDiff.py @@ -1,15 +1,13 @@ __author__ = 'chunk' -from mfeat import * +from . import * +from ..common import * +from ..mjpeg import * +from ..msteg import * +from ..msteg.steganalysis import MPB -from common import * import numpy as np -from mjpeg import * -from msteg import * -from msteg.steganalysis import MPB - - class FeatIntraBlockDiff(FeatureBase): def __init__(self): FeatureBase.__init__(self) diff --git a/mfeat/IntraBlockDiff.pyc b/mfeat/IntraBlockDiff.pyc index c3dc93e..ab9fe37 100644 Binary files a/mfeat/IntraBlockDiff.pyc and b/mfeat/IntraBlockDiff.pyc differ diff --git a/mfeat/__init__.py b/mfeat/__init__.py index c582ace..2e2236f 100644 --- a/mfeat/__init__.py +++ b/mfeat/__init__.py @@ -1,6 +1,7 @@ __author__ = 'chunk' -from common import * +from ..common import * + import numpy as np from PIL import Image import cv2 diff --git a/mfeat/__init__.pyc b/mfeat/__init__.pyc index b2f68a2..d25758b 100644 Binary files a/mfeat/__init__.pyc and b/mfeat/__init__.pyc differ diff --git a/mmodel/SVM.py b/mmodel/SVM.py index 3128213..c92a121 100644 --- a/mmodel/SVM.py +++ b/mmodel/SVM.py @@ -5,12 +5,12 @@ SVM Model. chunkplus@gmail.com 2014 Dec ''' -from mfeat import * -from mmodel import * -from svmutil import * -from mspark import SC +from ..mfeat import * +from . import * +from .svmutil import * +from ..mspark import SC +from ..common import * -from common import * import numpy as np import csv import json diff --git a/mmodel/SVM.pyc b/mmodel/SVM.pyc index 2299773..1ada143 100644 Binary files a/mmodel/SVM.pyc and b/mmodel/SVM.pyc differ diff --git a/mspark/SC.py b/mspark/SC.py index 605164f..cda6f64 100644 --- a/mspark/SC.py +++ b/mspark/SC.py @@ -1,7 +1,8 @@ __author__ = 'chunk' +from ..common import * + import sys -from common import * from dependencies import * from pyspark import SparkConf, SparkContext from pyspark.mllib.classification import LogisticRegressionWithSGD, SVMWithSGD diff --git a/mspark/SC.pyc b/mspark/SC.pyc index 7e5ca1d..932d32b 100644 Binary files a/mspark/SC.pyc and b/mspark/SC.pyc differ diff --git a/msteg/__init__.py b/msteg/__init__.py index 70ee204..635fd07 100644 --- a/msteg/__init__.py +++ b/msteg/__init__.py @@ -2,8 +2,8 @@ __author__ = 'chunk' import numpy as np -import mjpeg -from common import * +from ..mjpeg import Jpeg +from ..common import * __all__ = ['StegBase', 'sample_key'] @@ -31,7 +31,7 @@ class StegBase(object): """ Returns DCT coefficients of the cover image. """ - self.cov_jpeg = mjpeg.Jpeg(img_path) + self.cov_jpeg = Jpeg(img_path) self.key = self.cov_jpeg.getkey() self.cov_data = self.cov_jpeg.getCoefBlocks() return self.cov_data diff --git a/msteg/__init__.pyc b/msteg/__init__.pyc index a76dbb9..19cd925 100644 Binary files a/msteg/__init__.pyc and b/msteg/__init__.pyc differ diff --git a/msteg/steganalysis/ChiSquare.py b/msteg/steganalysis/ChiSquare.py index 88bdfdc..7d0bb2c 100644 --- a/msteg/steganalysis/ChiSquare.py +++ b/msteg/steganalysis/ChiSquare.py @@ -22,7 +22,7 @@ from scipy.stats import chisquare import matplotlib.pyplot as plt import itertools as it -from msteg import * +from .. import * class ChiSquare(StegBase): diff --git a/msteg/steganalysis/MPB.py b/msteg/steganalysis/MPB.py index 0464b21..745ca93 100644 --- a/msteg/steganalysis/MPB.py +++ b/msteg/steganalysis/MPB.py @@ -6,9 +6,10 @@ Yun Q. Shi, et al - A Markov Process Based Approach to Effective Attacking JPEG import time import math import numpy as np -from msteg import * -import mjpeg -from common import * + +from .. import * +from ...mjpeg import Jpeg,colorMap +from ...common import * import csv import json @@ -237,8 +238,8 @@ class MPB(StegBase): with open('res/tmp.model', 'rb') as modelfile: clf = pickle.load(modelfile) - im = mjpeg.Jpeg(image, key=sample_key) - ciq = im.coef_arrays[mjpeg.colorMap['Y']] + im = Jpeg(image, key=sample_key) + ciq = im.coef_arrays[colorMap['Y']] tpm = self.get_trans_prob_mat(ciq) return clf.predict(tpm) @@ -268,8 +269,8 @@ class MPB(StegBase): svm = cv2.SVM() svm.load('res/svm_data.model') - im = mjpeg.Jpeg(image, key=sample_key) - ciq = im.coef_arrays[mjpeg.colorMap['Y']] + im = Jpeg(image, key=sample_key) + ciq = im.coef_arrays[colorMap['Y']] tpm = self.get_trans_prob_mat(ciq) return svm.predict(tpm) diff --git a/msteg/steganalysis/MPB.pyc b/msteg/steganalysis/MPB.pyc index 6de0579..cd39c07 100644 Binary files a/msteg/steganalysis/MPB.pyc and b/msteg/steganalysis/MPB.pyc differ diff --git a/msteg/steganography/F3.py b/msteg/steganography/F3.py index a3be58b..dd3711d 100644 --- a/msteg/steganography/F3.py +++ b/msteg/steganography/F3.py @@ -3,8 +3,8 @@ __author__ = 'chunk' import math import numpy as np -from msteg import * -from common import * +from .. import * +from ...common import * class F3(StegBase): diff --git a/msteg/steganography/F4-simple.py b/msteg/steganography/F4-simple.py index 6fbb652..8f708b4 100644 --- a/msteg/steganography/F4-simple.py +++ b/msteg/steganography/F4-simple.py @@ -11,8 +11,9 @@ which is not included in the original description of F4. """ import numpy as np -from msteg import * -from common import * + +from .. import * +from ...common import * class F4(StegBase): diff --git a/msteg/steganography/F4.py b/msteg/steganography/F4.py index 2690307..bde8811 100644 --- a/msteg/steganography/F4.py +++ b/msteg/steganography/F4.py @@ -2,9 +2,10 @@ __author__ = 'chunk' import numpy as np import numpy.random as rnd -from msteg import * -import mjpeg -from common import * + +from .. import * +from ...common import * +from ...mjpeg import Jpeg class F4(StegBase): @@ -22,7 +23,7 @@ class F4(StegBase): """ Returns DCT coefficients of the cover image. """ - self.cov_jpeg = mjpeg.Jpeg(img_path, key=self.key) + self.cov_jpeg = Jpeg(img_path, key=self.key) cov_data = self.cov_jpeg.getsignal(channel='Y') self.cov_data = np.array(cov_data, dtype=np.int16) diff --git a/msteg/steganography/F5.py b/msteg/steganography/F5.py index ffc71ae..e743e49 100644 --- a/msteg/steganography/F5.py +++ b/msteg/steganography/F5.py @@ -26,10 +26,11 @@ which embedding function (one of JSteg, F3, F4) should be used. import math import numpy as np import numpy.random as rnd -from msteg import * -from F4 import F4 -import mjpeg -from common import * + +from .. import * +from .F4 import F4 +from ...mjpeg import Jpeg +from ...common import * class F5(StegBase): @@ -53,7 +54,7 @@ class F5(StegBase): """ Returns DCT coefficients of the cover image. """ - self.cov_jpeg = mjpeg.Jpeg(img_path, key=self.key) + self.cov_jpeg = Jpeg(img_path, key=self.key) cov_data = self.cov_jpeg.getsignal(channel='Y') self.cov_data = np.array(cov_data, dtype=np.int16) diff --git a/msteg/steganography/LSB.py b/msteg/steganography/LSB.py index bf41ef9..e5fd118 100644 --- a/msteg/steganography/LSB.py +++ b/msteg/steganography/LSB.py @@ -2,8 +2,9 @@ __author__ = 'chunk' import time import numpy as np -from msteg import * -from common import * + +from .. import * +from ...common import * class LSB(StegBase): -- libgit2 0.21.2