Giter VIP home page Giter VIP logo

document-dewarping-with-control-points's People

Contributors

gwxie 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

document-dewarping-with-control-points's Issues

When will the code and dataset be released?

The paper claims the code and dataset will be released in this repository. Can we have an estimate of when this will be added, since the conference has now taken place?

Thank you :)

评价指标

你好,请问你的代码评价指标MSSIM、LD、ED、CER这些在哪找到?在您给出的代码中并没有找到,请问是这些么?如果是请问每个字符代表的是什么,如果不是请问您的评价指标在哪可以找到,真诚的希望得到您的回复!万分感谢!
微信图片_20231221182614

python test.py报错

python test.py

Traceback (most recent call last):
File "test.py", line 183, in
train(args)
File "test.py", line 41, in train
_re_date = re_date.search(args.resume.name).group(0)
AttributeError: 'str' object has no attribute 'name'

网络结构

为什么您代码里面的网络结构和论文里面提出的网络结构不一样呢?您的论文提出用的是FCN编码器,但是您的代码里面用的是一段并行的网络结构,并不是FCN,请问这是怎么回事呢?

[issues dataloader]Pickle data was truncated

i have issues when i trained model with 13k sample
Traceback (most recent call last):
File "train.py", line 319, in
<_io.BufferedReader name='/home/admin1/mnt_raid/source/caopv/dewaping/Source/Dataset/Train/color/452new_40_2_fold.gw'>
train(args)
File "train.py", line 143, in train
for i, (images, labels, segment) in enumerate(trainloader):
File "/mnt/raid1/software_app/anaconda3/envs/doctr/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 652, in next
data = self._next_data()
File "/mnt/raid1/software_app/anaconda3/envs/doctr/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1327, in _next_data
<_io.BufferedReader name='/home/admin1/mnt_raid/source/caopv/dewaping/Source/Dataset/Train/color/new_1013_19_curve.gw'>
<_io.BufferedReader name='/home/admin1/mnt_raid/source/caopv/dewaping/Source/Dataset/Train/color/new_1324_17_fold.gw'>
return self._process_data(data)
File "/mnt/raid1/software_app/anaconda3/envs/doctr/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1373, in _process_data
data.reraise()
File "/mnt/raid1/software_app/anaconda3/envs/doctr/lib/python3.8/site-packages/torch/_utils.py", line 461, in reraise
raise exception
_pickle.UnpicklingError: Caught UnpicklingError in DataLoader worker process 3.
Original Traceback (most recent call last):
File "/mnt/raid1/software_app/anaconda3/envs/doctr/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop
data = fetcher.fetch(index)
File "/mnt/raid1/software_app/anaconda3/envs/doctr/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/mnt/raid1/software_app/anaconda3/envs/doctr/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/mnt/raid1/source/caopv/dewaping/Document-Dewarping-with-Control-Points/Source/dataloader.py", line 147, in getitem
perturbed_data = pickle.load(f)
_pickle.UnpicklingError: pickle data was truncated

paper reference

Could you tell which paper do you refer in this way? Thanks@gwxie

About train.py

Hello, there are some problems when I run the train.py as you said.Could you give me some help?
try:
FlatImg.validateOrTestModelV3(epoch, trian_t, validate_test='v_l4')
FlatImg.validateOrTestModelV3(epoch, 0, validate_test='t')
except:
print(' Error: validate or test')
the training output:【 Error: validate or test'】,I want to know what the function of this code ? Will this error affect the training process?
Looking forward to your reply!

More details about training

Thanks for sharing the code and dataset. The encoder-only architecture makes DDCP faster and lighter than other methods, I really like the idea. I try to reimplement the paper, however, some training details are missing in the paper.

loss
image

  1. What are α and β used for the pre-train model? In the utilsV4.py it's all equal 1

Experiments
image

  1. What are the total epochs for the pre-train model? In train.py, the default epochs=300

Proposed command when using cpu could be changed

First of all, thank you very much for your project!

I encountered a problem when using a cpu and executing the proposed command:
python test.py --data_path_test=./your/test/data/path/ --parallel None --schema test --batch_size 1

If you use parallel None the arg parameter parallel will not be None; you can leave the parameter because the default value is already None: python test.py --data_path_test=./your/test/data/path/ --schema test --batch_size 1

Best regards
Constantin

请教两个问题

希望矫正之后的图片保持与原图差不多的分辨率,如何调整参数?矫正后的图片不失真。
另外,目前发现矫正后的文字发生变形,有时变得扁平,有时变瘦长,能否做到不变形?谢谢!

About test result

图片1
Hello, first of all, thank you for your previous answers!Secondly, I encountered some problems when i run the file of test.py.The test results are shown in the figure above,as you can see,the fiducial points focus on upper left corner。Thirdly,what does the model output 【segment_regress】 represent ?Could you give me some suggestions?

How to use the sythesized dataset in this code?

I used your scripts for synthesizing my own dataset. However, I'm having trouble applying my dataset in training.
I followed your datasets in BaiduYun, and formed a directory as follows:
image

I found that the cv2.imread(im_path, flags=cv2.IMREAD_COLOR) cannot read the *.gw file in color, and I got a result like:
cv2.error: Caught error in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/xujh/miniconda3/envs/test/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 198, in _worker_loop
data = fetcher.fetch(index)
File "/home/xujh/miniconda3/envs/test/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/xujh/miniconda3/envs/test/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/xujh/Figure_process/Document-Dewarping-with-Control-Points/Source/dataloader.py", line 118, in getitem
im = self.resize_im(im)
File "/home/xujh/Figure_process/Document-Dewarping-with-Control-Points/Source/dataloader.py", line 173, in resize_im
im = cv2.resize(im, (992, 992), interpolation=cv2.INTER_LINEAR)
cv2.error: OpenCV(4.5.5) /io/opencv/modules/imgproc/src/resize.cpp:4052: error: (-215:Assertion failed) !ssize.empty() in function 'resize'
I realized I miss something really important and can you give some help?

训练出现'pickle data was truncated'错误

您好!在训练时出现'pickle data was truncated'错误,我重新下载了pkl文件还是出现同样的问题,想问一下是什么原因造成的呢?
完整的输出如下:

Namespace(arch='Document-Dewarping-with-Control-Points', batch_size=8, data_path_test=PosixPath('/home/alyson/PycharmProjects/Document-Dewarping-with-Control-Points/Source/dataset/fiducial1024/png'), data_path_train='/media/alyson/DataDisk1/fiducial1024/fiducial1024/fiducial1024_v1', data_path_validate='/media/alyson/DataDisk1/fiducial1024/fiducial1024/fiducial1024_v1/validate', img_shrink=None, l_rate=0.0002, n_epoch=300, optimizer='adam', output_path=PosixPath('/home/alyson/PycharmProjects/Document-Dewarping-with-Control-Points/Source/flat'), parallel=['0'], print_freq=60, resume=PosixPath('/home/alyson/PycharmProjects/Document-Dewarping-with-Control-Points/Source/ICDAR2021/2021-02-03 16:15:55/143/2021-02-03 16_15_55flat_img_by_fiducial_points-fiducial1024_v1.pkl'), schema='train')

------load DilatedResnetForFlatByFiducialPointsS2------

Loading model and optimizer from checkpoint '/home/alyson/PycharmProjects/Document-Dewarping-with-Control-Points/Source/ICDAR2021/2021-02-03 16:15:55/143/2021-02-03 16_15_55flat_img_by_fiducial_points-fiducial1024_v1.pkl'
Loaded checkpoint '2021-02-03 16_15_55flat_img_by_fiducial_points-fiducial1024_v1.pkl' (epoch 143)

  • lambda_loss :1 learning_rate :5e-05
    /home/alyson/anaconda3/envs/wave/lib/python3.8/site-packages/torch/nn/_reduction.py:42: UserWarning: size_average and reduce args will be deprecated, please use reduction='mean' instead.
    warnings.warn(warning.format(ret))
    [144][60/2308] [10.86 18.7846 32.55] [l1:8.5548 l:102.2232 e:0.0000 r:0.0000 s:0.7517] 18.7846 2023-03-07 16:23:33
    [144][120/2308] [11.70 19.4594 28.32] [l1:7.7310 l:117.2133 e:0.0000 r:0.0000 s:0.7067] 19.1220 2023-03-07 16:24:41
    [144][180/2308] [10.56 17.9781 42.29] [l1:6.9421 l:110.2881 e:0.0000 r:0.0000 s:0.7259] 18.7407 2023-03-07 16:25:52
    [144][240/2308] [10.04 18.7990 28.57] [l1:8.0336 l:107.5737 e:0.0000 r:0.0000 s:0.7993] 18.7553 2023-03-07 16:27:02
    [144][300/2308] [11.42 18.5368 35.10] [l1:7.5782 l:109.5079 e:0.0000 r:0.0000 s:0.7803] 18.7116 2023-03-07 16:28:17
    [144][360/2308] [10.29 18.0371 28.19] [l1:7.2705 l:107.5887 e:0.0000 r:0.0000 s:0.7711] 18.5992 2023-03-07 16:29:27
    Traceback (most recent call last):
    File "/home/alyson/PycharmProjects/Document-Dewarping-with-Control-Points/Source/train.py", line 334, in
    train(args)
    File "/home/alyson/PycharmProjects/Document-Dewarping-with-Control-Points/Source/train.py", line 143, in train
    for i, (images, labels, segment) in enumerate(trainloader):
    File "/home/alyson/anaconda3/envs/wave/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 521, in next
    data = self._next_data()
    File "/home/alyson/anaconda3/envs/wave/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1183, in _next_data
    return self._process_data(data)
    File "/home/alyson/anaconda3/envs/wave/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1229, in _process_data
    data.reraise()
    File "/home/alyson/anaconda3/envs/wave/lib/python3.8/site-packages/torch/_utils.py", line 425, in reraise
    raise self.exc_type(msg)
    _pickle.UnpicklingError: Caught UnpicklingError in DataLoader worker process 3.
    Original Traceback (most recent call last):
    File "/home/alyson/anaconda3/envs/wave/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
    data = fetcher.fetch(index)
    File "/home/alyson/anaconda3/envs/wave/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
    File "/home/alyson/anaconda3/envs/wave/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in
    data = [self.dataset[idx] for idx in possibly_batched_index]
    File "/home/alyson/PycharmProjects/Document-Dewarping-with-Control-Points/Source/dataloader.py", line 146, in getitem
    perturbed_data = pickle.load(f)
    _pickle.UnpicklingError: pickle data was truncated

A question about loss design

最近看了您的文章《document dewarping with control points》的开源代码,非常感谢您无私的开源工作。我关注到您的loss部分使用了Smooth L1 loss以及微分坐标的loss,这是和原文一致的。同时,我也主要到您的开源代码中同时也提供了edge loss和cross line loss, rectangle loss。请问您有试验过,加上这几种loss可以涨点吗?我的直觉想法也是edge部分的point可能会更加重要,但是没有进行过试验。

image

另外,文章中的图5中提到了设置超参数neighbor vertices k=5和k=17。我想问一下你有没有尝试过其他的k,k是否越大越好呢?

非常期待你的回复!

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.