Skip to main content

antiOCR

Anti OCR, Free Texts.

拒绝图片文字被OCR,让文字自由传播! antiOCR 把指定文本转换成机器无法识别但人可读的文字图片。

欢迎扫码加小助手为好友,备注 anti,小助手会定期统一邀请大家入群:

微信群二维码

作者也维护 知识星球私享群 ,这里面的提问会较快得到作者的回复,欢迎加入。知识星球私享群也会陆续发布一些开源项目相关的私有资料,包括一些使用教程,未公开的模型,不同应用场景的调用代码,使用过程中遇到的难题解答等。本群也会发布一些相关的最新研究资料。

使用说明

调用很简单,以下是示例:

from antiocr import AntiOcr

texts = '拒绝图片文字被OCR,让文字自由传播!  antiOCR 把指定文本转换成机器无法识别但人可读的文字图片。'
anti = AntiOcr()

# 生成文字图片
img = anti(
    texts,
    font_fp='/System/Library/Fonts/PingFang.ttc',  # 使用的字体文件
)
img.save("output.png")

使用示例可以参考 Streamlit Demo 。

目前 antiOCR 使用的反OCR方法主要包括:

  • 每个文字随机使用不同大小的字体;
  • 每个汉字按指定概率进行倒转(随机生成倒转角度);
  • 每个汉字按指定概率转换为中文拼音;
  • 【可选】随机生成干扰的背景图片;
  • 字体可按需指定;

示例

生成的图片 背景图片来源
固定背景图片 固定图片
固定背景图片 固定图片
固定背景图片 固定图片
随机背景图片 随机图片
随机背景图片 随机图片
随机背景图片 随机图片

安装

嗯,顺利的话一行命令即可。

pip install antiocr

安装速度慢的话,可以指定国内的安装源,如使用豆瓣源:

pip install antiocr -i https://pypi.doubanio.com/simple

给作者来杯咖啡

开源不易,如果此项目对您有帮助,可以考虑 给作者加点油🥤,鼓鼓气💪🏻 。


官方代码库:https://github.com/breezedeus/antiocr。

Metadata

Release files for antiocr 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for antiocr 0.1
File Size Uploaded
antiocr-0.1.tar.gz 283.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for antiocr 0.1
File Interpreter ABI Platform
antiocr-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 847.2 kB

Release files / antiocr-0.1.tar.gz

Download URL antiocr-0.1.tar.gz
Size 283.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e7215f501557367b7493fd91a5736a2fad1d4086563f525465c47bf4c78f6faa
BLAKE2b-256 checksum
How to use checksums
165fdb047436b52e5a80fdba670575acc7a0ec83f92655224c5454b6e0cc1156
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.28.1 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.8.3

Release files / antiocr-0.1-py3-none-any.whl

Download URL antiocr-0.1-py3-none-any.whl
Size 563.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab66e849554215bddc39a63ff180c5ea0e6ab34c949503eedd24c54cf5ae2264
BLAKE2b-256 checksum
How to use checksums
5ce6d4871a9732366fd2bfadba024641eef60aa1743fb53b6a758676faaf1109
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.28.1 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.8.3

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page