fengjian0106 / hed-tutorial-for-document-scanning Goto Github PK
View Code? Open in Web Editor NEWDocument Scanning With TensorFlow And OpenCV
Document Scanning With TensorFlow And OpenCV
模型加载就失败了
import cv2
if __name__ == '__main__':
net = cv2.dnn.readNet('hed_graph.pb')
报了下面这个错误
cv2.error: OpenCV(3.4.3) /io/opencv/modules/dnn/src/tensorflow/tf_importer.cpp:495: error: (-2:Unspecified error) Input layer not found: is_training in function 'connect'
opencv官方的例子也跑不起来。。。
作者你好, 我对这个工作很敢兴趣, 想自己训练一个网络, 请问下, 你贡献的那个模型, 在训练的时候 我看文章报道是合成了大概8万张 人为图片, 那请问下 实际在训练的时候, 就只用到这8万张合成图片?还是包含比如其他通用边缘检测例如BSDS500 这样的数据集
| #define PACKAGE_NAME "Protocol Buffers"
| #define PACKAGE_TARNAME "protobuf"
| #define PACKAGE_VERSION "3.5.0"
| #define PACKAGE_STRING "Protocol Buffers 3.5.0"
| #define PACKAGE_BUGREPORT "[email protected]"
| #define PACKAGE_URL ""
| #define PACKAGE "protobuf"
| #define VERSION "3.5.0"
| /* end confdefs.h. /
| #ifdef STDC
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| Syntax error
configure:5027: result: /lib/cpp
configure:5047: /lib/cpp conftest.c
./configure: line 1689: /lib/cpp: No such file or directory
configure:5047: $? = 127
configure: failed program was:
| / confdefs.h /
| #define PACKAGE_NAME "Protocol Buffers"
| #define PACKAGE_TARNAME "protobuf"
| #define PACKAGE_VERSION "3.5.0"
| #define PACKAGE_STRING "Protocol Buffers 3.5.0"
| #define PACKAGE_BUGREPORT "[email protected]"
| #define PACKAGE_URL ""
| #define PACKAGE "protobuf"
| #define VERSION "3.5.0"
| / end confdefs.h. /
| #ifdef STDC
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| Syntax error
configure:5047: /lib/cpp conftest.c
./configure: line 1689: /lib/cpp: No such file or directory
configure:5047: $? = 127
configure: failed program was:
| / confdefs.h /
| #define PACKAGE_NAME "Protocol Buffers"
| #define PACKAGE_TARNAME "protobuf"
| #define PACKAGE_VERSION "3.5.0"
| #define PACKAGE_STRING "Protocol Buffers 3.5.0"
| #define PACKAGE_BUGREPORT "[email protected]"
| #define PACKAGE_URL ""
| #define PACKAGE "protobuf"
| #define VERSION "3.5.0"
| / end confdefs.h. */
| #ifdef STDC
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| Syntax error
configure:5077: error: in /Users/luojie/WorkSpaceOfSaiDeSheng/WorkSpaceOfOpenCV/tensorflow-1.7.0-change-protobuf-namespace/tensorflow/contrib/makefile/downloads/protobuf': configure:5079: error: C preprocessor "/lib/cpp" fails sanity check See
config.log' for more details
代码还没有跑,但是看起来非常棒,思路很清晰,特此感谢~
i had been ported to android, but precise is less than ios.
the android underlying code is the same as ios since i using c++.
why?
tensorflow 1.7 android ios both
opencv ios the same as yours
android use the latest version of opencv, but code is the same as ios, since core code is same(c++)
你好,想请问下文章中所说的标注工具,是否有开放出来,感谢!
在文件fm_ocr_scanner.cpp中合并临近直线部分,没有使用合并后的结果。
利用tf.contrib.lite.TocoConverter.from_frozen_graph将提供的hed_graph.pb模型转换成.tflite,一直不成功,看提示应该是与Batch normalization相关。
另外,在freeze_model.py文件中is_training_placeholder是不是可以省略,dsn_fuse, dsn1, dsn2, dsn3, dsn4, dsn5 = mobilenet_v2_style_hed(image_float, batch_size, False),这里直接给False就行?
The order of "logits" and "targets" in sentences "cost = tf.nn.weighted_cross_entropy_with_logits(logits=logits, targets=label, pos_weight=pos_weight)" may be wrong in python 3.6.
batch response: This repository is over its data quota. Purchase more data packs to restore access.
error: failed to fetch some objects from 'https://github.com/fengjian0106/hed-tutorial-for-document-scanning.git/info/lfs'
tensorflow::Status load_graph_status = ReadBinaryProto(tensorflow::Env::Default(), pbPath, &graphDef);
在这行bad_access_error,博主有遇到过?
@fengjian0106 您好,我制作了你的那个数据集 3个多G,只不过中途运行退出了。不知道是不是这个大小。也成功运行了网络。但现在有一个小疑问,原始HED caffe代码,训练数据好像可以是任意尺寸,我想拿BSDS 数据来训练,就运行出错了。所以我想请教一下,如果要改进代码使得适应任意尺寸的数据?我想到最简单的方法就是吧数据全部缩放256 256 ,或者是我在tf中的指定一个尺寸 ,然后将输出结果缩放到原始尺寸,但应该不是这样做的吧?因为无论我怎么该const.height 与 width ,只能适应一个尺寸。
一直想找时间阅读下您的代码,终于最近有空。发现看起代码好累,尤其在卷积操作这块,完全搞不懂为什么这么写,而且网上也试着搜寻了一些资料,想搞明白你是根据怎样的思路来构建此模型训练的代码。为此我查阅了相关知识点,例如cost function 、weight 、bias 、NN 、CNN 、convergence、 overfitting、MobileNet是基于CNN在移动设备上的另一种实现等知识点、还看过hed的文献。
最后还是云里雾里的,我的初衷是想通过此项目入门AI,但是看起代码来进展很慢。
Hi :)
I would like to use this code to return the coordinates of the four corners; how can I do that?
With the Python instructions given in the README, I only get the resulting image, not the corners :s
原代码是:
if (diff < kSameSegmentsMaxAngle) { return true; }
这样角度0和178这样相似的线会被过滤掉,所以不应该是下面的过滤条件吗?
if (diff < kSameSegmentsMaxAngle || diff > 85) { return true; }
输出的检测到边缘的图片的尺寸能和原图一样吗
hi, when i run your code with my own dataset, it's crashed with below error:
OutOfRangeError (see above for traceback): FIFOQueue '_2_batch/fifo_queue' is closed and has insufficient elements (requested 1, current size 0)
[[Node: batch = QueueDequeueManyV2[component_types=[DT_FLOAT, DT_FLOAT, DT_STRING], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/device:CPU:0"](batch/fifo_queue, batch/n)]]
my dataset total 1996 color img and 1996 gray_thresh img, and i set batch=1, it's always crash at same point--at the 1994th img. I accept it's certainly almost run out the hole dataset,but why can't it reture from the 1th data to retrain again? Besize, i set my iterations=2000, but it's always crash at the 620th iterations and notice me no data. I want to know can it reuse my dataset when there is no sufficient data? Please help , Thanks!
作者您好,我在实现边缘检测网络时遇到了背景色全是灰色的情况,我查了一下,背景像素的预测结果全是0.5,请问造成这种情况的原因可能是什么呢?
https://www.tensorflow.org/lite/guide/ops_compatibility#unsupported_operations
现在好像支持 transpose_conv 操作了吧?
2.2 将 2.1 里面生成的图片,全部移动到 ./dataset/generate_sample_by_ios_image_size_256_256_thickness_0.2 目录里。
我不懂object_c,目前在学习训练模型,合成的图片能不能发给我邮箱一下[email protected]
或者能不能把合成图片的原理说一下,为什么要用Iphone模拟器合成
你好,打扰致歉。
在学习过程中遇到一些问题,希望能指点一二。
1.为什么要在iPhone模拟器上进行图片合成?
2.如果是安卓真机要怎么合成图片,依然可以在iPhone模拟器上进行合成吗?
不胜感激。
@fengjian0106
因为线段比较粗的问题,所以想打算重新训练模型。借此也了解一下人工智能相关开发。
但是因为我之前从未在人工智能这块有涉猎,所以一开始只是基于现有的模型,做开发。然后部署了android版的。
所以我需要做个时间评估,从0开始搞这块需要多久时间?或者你从一开始搞这块花了多久时间。
单张识别还可以,做成拍照实时预览识别,卡顿明显,尤其在比较差的机子上。
请问你在android是怎么处理的?
Hi!
First, awesome work you did :)
I had already developed a way to generate data, and I would like to use your training algorithm, but I need to know what kind of format you use (like image_path, top-left corner, top-right corner, ...).
I currently use Pascal VOC format (for Yolo), is the needed csv format different?
求教java种Mat如何转为float数组的啊,float数组又是如何转mat的啊,
我试了下纯opencv检测文档时,视频卡的不要不要的你们怎么处理的
FrameworkAndLib/FMHEDNet/libFMHEDNet.a (3 slices)
Undefined symbols for architecture x86_64:
"OBJC_CLASS$_FMHEDNet", referenced from:
objc-class-ref in ViewController.o
"ProcessEdgeImage(cv::Mat, cv::Mat, bool)", referenced from:
-[ViewController processImage:] in ViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
作者你好:请问下,在hed中 最终的 fused 输出不需要进行sigmod 压缩像素点到0-1之间么? 你的loss来看 是使用了 tf.nn.weighted_cross_entropy_with_logits 里面是对 logis 进行sigmod 压缩的 这点不是太理解..
我发现这篇文章:https://blogs.dropbox.com/tech/2016/08/fast-document-rectification-and-enhancement/#disqus_thread
但是不知道怎么求解Poisson’s equation 用conjugate gradient descent。
网上搜索了大量资料,没有一个类似的demo。
请问你知道么?
您好,在进行边缘检测的时候,数据量过大的时候不能单凭借loss是否收敛来判断网络训练好吧,或者肉眼观察网络检测结果,请问,您在对模型进行训练的时候是如何定量评估网络训练结果的呢?
请问样本合成的时候,样本有了,但是样本对应的标签,也就是边缘是怎么得到的呢?
1、TensorFlow版本是多少
2、OpenCV需要吗
你们训练、测试环境都没讲清楚啊
不好意思,冒昧问题您提供的权重只训练了130步嘛。。
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.