Giter Club home page Giter Club logo

2019-ccf-bdci-ocr-mczj-ocr-identificationidelement's People

Contributors

light201212 avatar mingtzge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

2019-ccf-bdci-ocr-mczj-ocr-identificationidelement's Issues

Some question on Pix2Pix

Hey, You mentioned you make some modifications to the Pix2pix model in this repo.

Roughly checking your repo and original Pix2Pix model, I got these modifications below:

  • Added --add_contrast in base_options.py
  • Commented the Visualizer part
  • Changed a function into lambda function in 'get_norm_layer' from networks.py

I wonder is there more modification on the Pix2Pix part of your repo? You also claimed you make data augmentation and could you please add more detail of that?

身份证元素提取模板

你好~
身份证元素提取模板图片在template_imgs里面没有,能够提供一下吗,想研究一下模板匹配这一块的代码?

关于tensorflow-gpu版本

我的cuda是10版的不支持tensorflow-gpu1.12.0所以下的1.13.1版本的tensorflow-gpu,运行mainprocess.py时,在recognize_process下的test_crnn_jmz.py的一行代码‘saver = tf.train.Saver()'报错了,错误信息是“OutOfRangeError:Read less bytes than requested”,该怎么处理呢?

git-clone error with git-lfs

hi-我试图运行代码,但这个lfs文件无法下载,请问下有没有什么解决方案?感谢!~

git clone https://github.com/Mingtzge/2019-CCF-BDCI-OCR-MCZJ-OCR-IdentificationIDElement.git
Cloning into '2019-CCF-BDCI-OCR-MCZJ-OCR-IdentificationIDElement'...
remote: Enumerating objects: 150, done.
remote: Counting objects: 100% (150/150), done.
remote: Compressing objects: 100% (135/135), done.
remote: Total 305 (delta 38), reused 97 (delta 11), pack-reused 155
Receiving objects: 100% (305/305), 1.82 MiB | 32.72 MiB/s, done.
Resolving deltas: 100% (56/56), done.
Downloading data_correction_and_generate_csv_file/data/repitle_address_extract.json (27 MB)
Error downloading object: data_correction_and_generate_csv_file/data/repitle_address_extract.json (f6021cc): Smudge error: Error downloading data_correction_and_generate_csv_file/data/repitle_address_extract.json (f6021cc1b6e451a4572698eedf9a48cfad2c14fdd392e6d9fcc8644541816f00): batch response: This repository is over its data quota. Account responsible for LFS bandwidth should purchase more data packs to restore access.

Errors logged to /home/ec2-user/SageMaker/2019-CCF-BDCI-OCR-MCZJ-OCR-IdentificationIDElement/.git/lfs/logs/20200218T054034.97028677.log
Use git lfs logs last to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: data_correction_and_generate_csv_file/data/repitle_address_extract.json: smudge filter lfs failed
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

test model

when i run test.py the result as follows:
图片

it didn't work to erase the watermark

cut_twist_process中template生成方式

您好,当我使用自定义身份证图片进行测试时,发现twist模块将原本正着的图像进行了反转,我怀疑时用于进行比较的template中的模版图片的通用性不够,故而想自己生成。

想请教下,这里template文件的生成方式?是否是twist_part中的gaussian_blur函数即可?还是否需要进行灰度锐化等操作?

感谢!

recognise model

model_save下的识别模型是不是有问题,运行mytest_crnn.py加载模型总是不对,
021-02-01 09:46:44.007098: W tensorflow/core/framework/op_kernel.cc:1502] OP_REQUIRES failed at save_restore_tensor.cc:175 : Data loss: Unable to open table file /recognize_process/model_save: Failed precondition: ./recognize_process/model_save; Is a directory: perhaps your file is in a different file format and you need to use a different restore operator?
Traceback (most recent call last):
File ".local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1356, in _do_call
return fn(*args)
File "local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1341, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File ".local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1429, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.DataLossError: Unable to open table file r/recognize_process/model_save: Failed precondition: /recognize_process/model_save; Is a directory: perhaps your file is in a different file format and you need to use a different restore operator?
[[{{node save/RestoreV2}}]]

关于签发机关纠正问题

大佬,项目中unit.json中签发机关的内容不太对,以’南京市栖霞区公安局‘为例,身份证背面的签发机关真正的内容为’南京市公安局栖霞分局‘,是还有其他转换逻辑吗?

repitle_address_extract.json

Hi,
It shows 25.6 MB but what I can see are 3 lines, could you please add a download link for this file?

version https://git-lfs.github.com/spec/v1
oid sha256:f6021cc1b6e451a4572698eedf9a48cfad2c14fdd392e6d9fcc8644541816f00
size 26857155

json文件读取报错

hi 在使用测试代码运行时,发现如下报错,json文件是从百度网盘下载的,预览看的时候也显示有问题,其他两个json读取没有问题,请问下是什么可能的原因呢?谢谢!

`UnicodeDecodeError Traceback (most recent call last)
in ()
2 unit_json = "./data_correction_and_generate_csv_file/data/unit.json" # 签发机关数据库
3 id_json = "./data_correction_and_generate_csv_file/data/repitle_address_extract.json" # 地址数据库
----> 4 unit_id_json = json.load(open(id_json, "r", encoding="utf-8"))

~/anaconda3/envs/amazonei_tensorflow_p36/lib/python3.6/json/init.py in load(fp, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
294
295 """
--> 296 return loads(fp.read(),
297 cls=cls, object_hook=object_hook,
298 parse_float=parse_float, parse_int=parse_int,

~/anaconda3/envs/amazonei_tensorflow_p36/lib/python3.6/codecs.py in decode(self, input, final)
319 # decode input (taking the buffer into account)
320 data = self.buffer + input
--> 321 (result, consumed) = self._buffer_decode(data, self.errors, final)
322 # keep undecoded input until the next call
323 self.buffer = data[consumed:]

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8d in position 21908442: invalid start byte`

About data download

由于百度云盘链接很容易失效。所以需要数据的朋友请添加我为百度云盘好友,我的账号1713983016@@qq.com,我将通过好友分享的方式分享给大家,备注信息:”2019 CCF BDCI OCR 赛题数据“

测试程序运行出错

NameError Traceback (most recent call last)
~/code/OCR/main_process.py in ()
77 # 去水印和对图片进行切割和处理
78 watermask_handler = WatermarkRemover(args, header_dir, cut_twisted_save_path)
---> 79 watermask_handler.watermask_remover_run()
80 recognize_image_path = os.path.join(header_dir, "test_data_preprocessed")
81 recognize_txt_path = os.path.join(header_dir, "test_data_txts")

~/code/OCR/watermask_remover_and_split_data/watermask_process.py in watermask_remover_run(self)
222 self.gan_gen_result()
223 if not args.no_rec_img: # 将去好水印的图片恢复到原图
--> 224 print("running rec_img ....")
225 self.recover_origin_img()
226 self.ori_img_path = self.recover_image_dir # 将原始图片路径改为去过水印之后的图片路径

~/code/OCR/watermask_remover_and_split_data/watermask_process.py in recover_origin_img(self)
168 result_dir = os.path.join(self.gan_result_dir, self.pixel_mode, "test_latest", "images")
169 if not os.path.exists(result_dir):
--> 170 print("not exists gan result dir")
171 exit(0)
172 result_img_names = os.listdir(result_dir)

NameError: name 'exit' is not defined

CGAN data

HI:
what datasets you train CGAN to erase watermark like?,i test an full image but the data you generate is not an full image,it's just a small picture which include watermark only

test error

when i run test.py in pytorch-CycleGAN-and-pix=pix2pix to predict and i loadmodel with latest_net_G.pth and i raise AttributeError: 'Sequential' object has no attribute 'model'

def __patch_instance_norm_state_dict(self, state_dict, module, keys, i=0):
    """Fix InstanceNorm checkpoints incompatibility (prior to 0.4)"""
    key = keys[i]
    if i + 1 == len(keys):  # at the end, pointing to a parameter/buffer
        if module.__class__.__name__.startswith('InstanceNorm') and \
                (key == 'running_mean' or key == 'running_var'):
            if getattr(module, key) is None:
                state_dict.pop('.'.join(keys))
        if module.__class__.__name__.startswith('InstanceNorm') and \
           (key == 'num_batches_tracked'):
            state_dict.pop('.'.join(keys))
    else:
        self.__patch_instance_norm_state_dict(state_dict, getattr(module, key), keys, i + 1) 

char_map.json文件生成方式

您好,

我想用自己的数据集finetune一下这个crnn的模型,想请教一下,训练用到的char_map.json是否为一个自己生成的字典文件?根据自己的训练数据里面出现的字符列出即可?
另外,在annotation file里面是不是就是 path/xxx.jpg 标注文字这样的格式的一个标注文件?标注文字是没有根据字典文件转换index的?
想确认一下数据格式是否正确!感谢!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.