mhliao / db Goto Github PK
View Code? Open in Web Editor NEWA PyTorch implementation of "Real-time Scene Text Detection with Differentiable Binarization".
A PyTorch implementation of "Real-time Scene Text Detection with Differentiable Binarization".
Hi, thanks for the awesome job. Could you provide the pretrained synthtext model on resnet-18?
Hi, Minghui, thanks to your nice work, here are some question to ask you:
Above all are my question and my thoughs.
/usr/local/cuda:/usr/local/cuda:/usr/local/cuda-9.0/bin/nvcc -I/home/nmt/anaconda3/envs/pytorch1_2/lib/python3.6/site-packages/torch/include -I/home/nmt/anaconda3/envs/pytorch1_2/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/nmt/anaconda3/envs/pytorch1_2/lib/python3.6/site-packages/torch/include/TH -I/home/nmt/anaconda3/envs/pytorch1_2/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda:/usr/local/cuda:/usr/local/cuda-9.0/include -I/home/nmt/anaconda3/envs/pytorch1_2/include/python3.6m -c src/deform_conv_cuda_kernel.cu -o build/temp.linux-x86_64-3.6/src/deform_conv_cuda_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=deform_conv_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
unable to execute '/usr/local/cuda:/usr/local/cuda:/usr/local/cuda-9.0/bin/nvcc': No such file or directory
error: command '/usr/local/cuda:/usr/local/cuda:/usr/local/cuda-9.0/bin/nvcc' failed with exit status 1
试过更改.brashrc的CUDA的环境变量,但是不行,这个问题要怎么解决?
这一行为什么要设置canvas 的最小值是0.3?
https://github.com/MhLiao/DB/blob/master/data/processes/make_border_map.py#L41
python train.py ./experiments/seg_detector/base_totaltext.yaml --num_gpus 2
Traceback (most recent call last):
File "train.py", line 70, in
main()
File "train.py", line 60, in main
experiment_args = conf.compile(conf.load(args['exp']))['Experiment']
KeyError: 'Experiment'
Traceback (most recent call last):
File "train.py", line 70, in
main()
File "train.py", line 60, in main
experiment_args = conf.compile(conf.load(args['exp']))['Experiment']
KeyError: 'Experiment'
could you please upload weight on google drive
When I run python3 eval.py, raise NotImplementedError. why? how to slove it?
请问训练自己的数据集时,除了数据路径外,其他参数还有哪些需要注意的,涉及到哪些参数,谢谢
支持!
dcn模块是否可以运行在CPU上??
python train.py experiments/seg_detector/ic15_resnet50_deform_thre.yaml --num_gpus 4
[INFO] [2019-12-05 05:32:38,907] Training epoch 0
error in modulated_deformable_col2im_coord_cuda: invalid device function
error in modulated_deformable_col2im_cuda: invalid device function
你好,我看到yaml文件里有很多参数,不太清楚某些参数的具体意义,请问你什么时候有时间可以给我们解释一下这些参数的用处吗
D:/STL/software/Anaconda/Anaconda33/envs/DB/lib/site-packages/torch/include\c10/util/order_preserving_flat_hash_map.h(1502): error C3203: “templated_iterator”: 未专用化的 类 模板 不能用作 模板 变量,该变量属于 模板 参数“_Ty1”,应为 real 类型
D:/STL/software/Anaconda/Anaconda33/envs/DB/lib/site-packages/torch/include\c10/util/order_preserving_flat_hash_map.h(1560): note: 参见对正在编译的类 模板 实例化“ska_ordered::order_preserving_flat_hash_map<K,V,H,E,A>”的引用
D:/STL/software/Anaconda/Anaconda33/envs/DB/lib/site-packages/torch/include\c10/util/order_preserving_flat_hash_map.h(1506): error C3203: “templated_iterator”: 未专用化的 类 模板 不能用作 模板 变量,该变量属于 模板 参数“_Ty1”,应为 real 类型
D:/STL/software/Anaconda/Anaconda33/envs/DB/lib/site-packages/torch/include\c10/util/order_preserving_flat_hash_map.h(1514): error C3203: “templated_iterator”: 未专用化的 类 模板 不能用作 模板 变量,该变量属于 模板 参数“_Ty1”,应为 real 类型
D:/STL/software/Anaconda/Anaconda33/envs/DB/lib/site-packages/torch/include\c10/util/order_preserving_flat_hash_map.h(1596): error C3203: “templated_iterator”: 未专用化的 类 模板 不能用作 模板 变量,该变量属于 模板 参数“_Ty1”,应为 real 类型
D:/STL/software/Anaconda/Anaconda33/envs/DB/lib/site-packages/torch/include\c10/util/order_preserving_flat_hash_map.h(1633): note: 参见对正在编译的类 模板 实例化“ska_ordered::flat_hash_set<T,H,E,A>”的引用
D:/STL/software/Anaconda/Anaconda33/envs/DB/lib/site-packages/torch/include\c10/util/order_preserving_flat_hash_map.h(1601): error C3203: “templated_iterator”: 未专用化的 类 模板 不能用作 模板 变量,该变量属于 模板 参数“_Ty1”,应为 real 类型
D:/STL/software/Anaconda/Anaconda33/envs/DB/lib/site-packages/torch/include\c10/util/order_preserving_flat_hash_map.h(1605): error C3203: “templated_iterator”: 未专用化的 类 模板 不能用作 模板 变量,该变量属于 模板 参数“_Ty1”,应为 real 类型
D:/STL/software/Anaconda/Anaconda33/envs/DB/lib/site-packages/torch/include\c10/util/order_preserving_flat_hash_map.h(1609): error C3203: “templated_iterator”: 未专用化的 类 模板 不能用作 模板 变量,该变量属于 模板 参数“_Ty1”,应为 real 类型
D:/STL/software/Anaconda/Anaconda33/envs/DB/lib/site-packages/torch/include\c10/util/order_preserving_flat_hash_map.h(1613): error C3203: “templated_iterator”: 未专用化的 类 模板 不能用作 模板 变量,该变量属于 模板 参数“_Ty1”,应为 real 类型
Please check the trained model link, I just find some ground truth files?
Thanks for your excellent work! But I have a question, why I get the inconsistent results with the ones reported in paper when testing the fintuned resnet-18 backbone on TotalText?
Hi Minghui, thanks for your awesome work!
I found that adding --visulize after the evaluation command will generate the visualization results for only the threshold map. I'm wondering how can I generate or obtain the visualization result for predicted characters?
Thank you!
When running:
python eval.py ./experiments/seg_detector/base.yaml --resume ./modelz/totaltext_resnet50 --polygon --box_thresh 0.6
I get error:
Traceback (most recent call last):
File "eval.py", line 8, in <module>
from trainer import Trainer
File "/home/home/p9/DB/trainer.py", line 6, in <module>
from experiment import Experiment
File "/home/home/p9/DB/experiment.py", line 4, in <module>
from structure.representers import *
File "/home/home/p9/DB/structure/representers/__init__.py", line 2, in <module>
from .boxes_from_map import boxes_from_map
ModuleNotFoundError: No module named 'structure.representers.boxes_from_map'
When mask.sum() ==0
in this line https://github.com/MhLiao/DB/blob/master/decoders/l1_loss.py#L10,the l1loss will get nan
How to use the pre-trained model of SynthDat for finetuning? How to add this weight to train.py
script?
pip install -r requirement.txt
ERROR: Failed building wheel for geventwebsocket
Maybe you want to replace geventwebsocket
, because it is failing to build.
Dear author, I wanted to train the model with command "python train.py experiments/seg_detector/base_totaltext.yaml --num_gpus 8", and the error raise that
File "train.py", line 72, in
main()
File "train.py", line 62, in main
experiment_args = conf.compile(conf.load(args['exp']))['Experiment']
KeyError: 'Experiment'
How can I solve these problem?
Any scripts test on a single image?
pip install -r requirements.txt
没有 requirements.txt 没有 s
pip install -r requirement.txt
When training the model with totaltext, I got this error when running the command
python mytrain.py experiments/seg_detector/totaltext_resnet18_deform_thre.yaml --num_gpus 4
. Can you help me? Thank you!
libibverbs: Warning: no userspace device-specific driver found for /sys/class/infiniband_verbs/uverbs0
Traceback (most recent call last): File "train.py", line 72, in <module> main() File "train.py", line 69, in main trainer.train() File "/DB/trainer.py", line 86, in train epoch=epoch, step=self.steps) File "/DB/trainer.py", line 127, in train_step if step % self.experiment.logger.log_interval == 0: TypeError: unsupported operand type(s) for %: 'int' and 'NoneType'
Dear author, Could you give me the information about your training time and your computing resource?
I found it cost about 50min with 4 Titian Xp GPUs to train one epoch. Is it normal ?
After inputting the probability map and threshold map into eq.2, what post processing should we do for the fianl results? Particularly, if P equal to T, the output is a median value (1/2). It seems that there are many noises in the final binary map, so can you tell us the detailed inference?
Thank you~
page 7 table 5: CDAFT (Baek et al. 2019) 89.8 84.3 86.9 may be CRAFT
你好,感谢你的工作,我在试图评估时报错
IndexError: list index out of range
具体如下:
python eval.py experiments/seg_detector/totaltext_resnet50_deform_thre.yaml --resume models/totaltext_resnet50 --polygon --box_thresh 0.6
Traceback (most recent call last):
File "eval.py", line 193, in
main()
File "eval.py", line 77, in main
experiment = Configurable.construct_class_from_config(experiment_args)
File "./DB/concern/config.py", line 130, in construct_class_from_config
return cls(**args)
File "./DB/experiment.py", line 96, in init
self.load_all(**kwargs)
File "./DB/concern/config.py", line 143, in load_all
self.load(name, **kwargs)
File "./DB/concern/config.py", line 151, in load
(kwargs[state_name], cmd)))
File "./DB/concern/config.py", line 164, in create_member_from_config
return cls(**args, cmd=cmd)
File "./DB/experiment.py", line 37, in init
self.load_all(**kwargs)
File "./DB/concern/config.py", line 143, in load_all
self.load(name, **kwargs)
File "./DB/concern/config.py", line 151, in load
(kwargs[state_name], cmd)))
File "./DB/concern/config.py", line 164, in create_member_from_config
return cls(**args, cmd=cmd)
File "./DB/data/data_loader.py", line 29, in init
self.load_all(**kwargs)
File "./DB/concern/config.py", line 143, in load_all
self.load(name, **kwargs)
File "./DB/concern/config.py", line 151, in load
(kwargs[state_name], cmd)))
File "./DB/concern/config.py", line 164, in create_member_from_config
return cls(**args, cmd=cmd)
File "./DB/data/image_dataset.py", line 33, in init
self.get_all_samples()
File "./DB/data/image_dataset.py", line 37, in get_all_samples
with open(self.data_list[i], 'r') as fid:
IndexError: list index out of range
我使用的是python 3.7.5 pytorch 1.3.1 cuda 10.1
请问我该怎么做?
I find this error when I run eval.py and demo.py, it seemed something went wrong with the data input?
File "eval.py", line 194, in
main()
File "eval.py", line 80, in main
Eval(experiment, experiment_args, cmd=args, verbose=args['verbose']).eval(args['visualize'])
File "eval.py", line 177, in eval
pred = model.forward(batch, training=False)
File "/ssd/xmzhang/TextDetection/lab1/DB/structure/model.py", line 56, in forward
pred = self.model(data, training=self.training)
TypeError: forward() missing 1 required positional argument: 'data'
提供的datasets百度网盘链接里的total_text文件夹中没有train_images和test_images文件
当然我们相信各位的工作,相信速度很快,我们不需要再去测试速度,我觉得没什么意义,我们需要的是简单的加载模型,进行预测。现在的代码是各种类,各种跳转,各种参数还不知道啥意思。。。。好南。。。。。。。。
(db) home@home-desktop:~/p9/DB$ python eval.py ./experiments/seg_detector/base.yaml --resume ./modelz/totaltext_resnet50 --polygon --box_thresh 0.6
Traceback (most recent call last):
File "eval.py", line 193, in <module>
main()
File "eval.py", line 75, in main
experiment_args = conf.compile(conf.load(args['exp']))['Experiment']
KeyError: 'Experiment'
@MhLiao test the code, both train.py
and eval.py
请问博主,模型对中文检测是不是效果比较差,而且容易把二维码的纹理识别成字,我用demo.py测试一些电商图片效果很差
In concern.config there is no class name State,but this class is import in many files
之前一直在用tensorflow,所以synthtext这个数据集的图片和标注都是处理成tfrecord的格式。这边用syntntext数据集进行训练的时候需要怎么处理呢?处理成一张图片img_name.jpg对应标注img_name.txt的形式吗?
还有一个问题就是,对于只有四个坐标点的数据怎么转换到和你这个一样的标签上
home@home-desktop:~/p9/DB/datasets/total_text$ tree -L 1
.
├── test_gts
├── test_images
├── test_list.txt
├── train_gts
├── train_images
└── train_list.txt
(db) home@home-desktop:~/p9/DB$ python eval.py experiments/seg_detector/totaltext_resnet18_deform_thre.yaml --resume ./modelz/totaltext_resnet18 --polygon --box_thresh 0.6
./datasets/total_text/
[INFO] [2019-12-04 19:50:45,447] Resuming from ./modelz/totaltext_resnet18
[INFO] [2019-12-04 19:50:45,496] Resumed from ./modelz/totaltext_resnet18
0%| | 0/300 [00:01<?, ?it/s]
Traceback (most recent call last):
File "eval.py", line 193, in <module>
main()
File "eval.py", line 79, in main
Eval(experiment, experiment_args, cmd=args, verbose=args['verbose']).eval(args['visualize'])
File "eval.py", line 176, in eval
pred = model.forward(batch, training=False)
File "/home/home/p9/DB/structure/model.py", line 56, in forward
pred = self.model(data, training=self.training)
File "/home/home/anaconda3/envs/db/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in __call__
result = self.forward(*input, **kwargs)
File "/home/home/anaconda3/envs/db/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 152, in forward
outputs = self.parallel_apply(replicas, inputs, kwargs)
File "/home/home/anaconda3/envs/db/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 162, in parallel_apply
return parallel_apply(replicas, inputs, kwargs, self.device_ids[:len(replicas)])
File "/home/home/anaconda3/envs/db/lib/python3.6/site-packages/torch/nn/parallel/parallel_apply.py", line 85, in parallel_apply
output.reraise()
File "/home/home/anaconda3/envs/db/lib/python3.6/site-packages/torch/_utils.py", line 385, in reraise
raise self.exc_type(msg)
TypeError: Caught TypeError in replica 1 on device 1.
Original Traceback (most recent call last):
File "/home/home/anaconda3/envs/db/lib/python3.6/site-packages/torch/nn/parallel/parallel_apply.py", line 60, in _worker
output = module(*input, **kwargs)
File "/home/home/anaconda3/envs/db/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in __call__
result = self.forward(*input, **kwargs)
TypeError: forward() missing 1 required positional argument: 'data'
Segmentation fault
Dear author:
When I trained the model, I found the Volatile GPU-Util equal to 0%. Is anything wrong with my method?
+-------------------------------+----------------------+----------------------+
| 8 TITAN Xp On | 00000000:8E:00.0 Off | N/A |
| 23% 32C P2 65W / 250W | 1683MiB / 12196MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 9 TITAN Xp On | 00000000:8F:00.0 Off | N/A |
| 23% 34C P2 60W / 250W | 1685MiB / 12196MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 10 TITAN Xp On | 00000000:90:00.0 Off | N/A |
| 23% 31C P2 61W / 250W | 1685MiB / 12196MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
| 11 TITAN Xp On | 00000000:91:00.0 Off | N/A |
| 23% 31C P2 60W / 250W | 1693MiB / 12196MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.