-
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
version 0.3.1: now we can choose different chr_type to get better per…
…formance
- Loading branch information
1 parent
77367b4
commit af6dd05
Showing
8 changed files
with
149 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from text_blind_watermark import TextBlindWatermark2 | ||
|
||
password = '20190808' | ||
text = '这句话中有盲水印,你能提取出来吗?' | ||
watermark = 'github.com/guofei9987' | ||
|
||
text_blind_wm = TextBlindWatermark2(password=password) | ||
|
||
text_with_wm = text_blind_wm.embed(text=text, watermark=watermark) | ||
print(text_with_wm) | ||
|
||
# %% | ||
|
||
text_blind_wm2 = TextBlindWatermark2(password=password) | ||
wm_extract = text_blind_wm2.extract(text_with_wm) | ||
print('提取内容:', wm_extract) | ||
|
||
assert watermark == wm_extract | ||
|
||
# %% put watermark by index | ||
text_blind_wm3 = TextBlindWatermark2(password=password) | ||
|
||
text_with_wm = text_blind_wm2.embed(text=text, watermark=watermark, idx=0) | ||
assert text_blind_wm2.extract(text_with_wm) == wm_extract | ||
|
||
text_with_wm = text_blind_wm2.embed(text=text, watermark=watermark, idx=len(text)) | ||
assert text_blind_wm2.extract(text_with_wm) == wm_extract | ||
|
||
# %% | ||
|
||
text_blind_wm4 = TextBlindWatermark2(password=password, chr_type=(3, 4)) | ||
text_with_wm = text_blind_wm.embed(text=text, watermark=watermark) | ||
print(text_with_wm) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from text_blind_watermark import TextBlindWatermark2 | ||
|
||
password = '20190808' | ||
text = '这句话中有盲水印,你能提取出来吗?' | ||
watermark = 'github.com/guofei9987' | ||
|
||
text_blind_wm = TextBlindWatermark2(password=password, chr_type=(3, 4)) | ||
|
||
text_with_wm = text_blind_wm.embed(text=text, watermark=watermark) | ||
print(text_with_wm) | ||
|
||
text_blind_wm2 = TextBlindWatermark2(password=password, chr_type=(3, 4)) | ||
wm_extract = text_blind_wm2.extract(text_with_wm) | ||
print('提取内容:', wm_extract) | ||
|
||
assert watermark == wm_extract |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from .text_blind_watermark import TextBlindWatermark, TextBlindWatermarkThin | ||
from .text_blind_watermark import TextBlindWatermark, TextBlindWatermark2 | ||
|
||
__version__ = '0.2.1' | ||
__version__ = '0.3.1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters