├── README.md ├── docker-compose.yaml └── ocr └── chi_sim.traineddata /README.md: -------------------------------------------------------------------------------- 1 | # font_ocr 2 | 3 | # css字体反混淆一键部署方案 4 | 5 | git图片显示有问题 6 | 可以看这 [链接](https://www.jianshu.com/p/3c57371a0e89) 7 | 8 | 提供api 9 | - url 反混淆文本使用的woff 链接 10 | - content 需要反混淆的文本 11 | ``` 12 | api 13 | curl -X POST \ 14 | http://119.29.27.234:8088/ocr \ 15 | -H 'cache-control: no-cache' \ 16 | -H 'content-type: application/json' \ 17 | -H 'postman-token: a4bb25a3-15a1-50d0-612a-8f804df49c14' \ 18 | -d '{"url": "https://vfile.meituan.net/colorstone/f0a30a4dda64b4f8f344858115f54fc92296.woff", "content": ""}' 19 | 20 | ``` 21 | 22 | 23 | 24 | 25 | 26 | 配置阿里镜像源 27 | 28 | 29 | ``` 30 | sudo mkdir -p /etc/docker 31 | 32 | sudo tee /etc/docker/daemon.json <<-'EOF' 33 | 34 | { 35 | 36 | "registry-mirrors": ["https://uxk0ognt.mirror.aliyuncs.com"] 37 | 38 | } 39 | 40 | EOF 41 | 42 | sudo systemctl daemon-reload 43 | 44 | sudo systemctl restart docker 45 | ``` 46 | 47 | 48 | 本地部署 49 | 50 | ``` 51 | # 安装docker 52 | # 安装docker-compose 53 | # pip3 install docker-compose 54 | # 进入docker-compose.yaml所在目录 55 | # 本地化部署 56 | docker-compose up -d 57 | ``` 58 | 59 | 60 | 案例 61 | 62 | 提取混淆文字  63 | ![猫眼电影](./WeChatcdd5a362ebe748bdb421d72690e230d2.png) 64 | 提取字体url //vfile.meituan.net/colorstone/f0a30a4dda64b4f8f344858115f54fc92296.woff 65 | ![猫眼字体](./WeChat266ab2365b961ab91d61f7bb85ad9c84.png) 66 | 67 | 68 | 测试 69 | ``` 70 | url : http://119.29.27.234:8088/ocr 71 | jsonData: 72 | - content:  73 | - url: https://vfile.meituan.net/colorstone/f0a30a4dda64b4f8f344858115f54fc92296.woff 74 | ``` 75 | curl 测试 76 | ``` 77 | curl -X POST \ 78 | http://119.29.27.234:8088/ocr \ 79 | -H 'cache-control: no-cache' \ 80 | -H 'content-type: application/json' \ 81 | -H 'postman-token: a4bb25a3-15a1-50d0-612a-8f804df49c14' \ 82 | -d '{"url": "https://vfile.meituan.net/colorstone/f0a30a4dda64b4f8f344858115f54fc92296.woff", "content": ""}' 83 | 84 | ``` 85 | 86 | ![识别结果](./WeChat2379f547c470d509a4b25b2e503f446d.png) -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | artio_ocr: 4 | image: registry.cn-shanghai.aliyuncs.com/artio/artio_ocr 5 | container_name: artio_ocr 6 | # 配置chi_sim 其他数据集 7 | #volumes: 8 | # - ./ocr/chi_sim.traineddata:/usr/share/tesseract-ocr/tessdata/chi_sim.traineddata 9 | environment: 10 | - "TZ=Asia/Shanghai" 11 | ports: 12 | - 8088:8088 13 | tty: true 14 | 15 | -------------------------------------------------------------------------------- /ocr/chi_sim.traineddata: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luopeixiong/font_ocr/877ab8afc946dca1f6a1d5923b1560a0f0a259fc/ocr/chi_sim.traineddata --------------------------------------------------------------------------------