-
大小: 1.97MB文件类型: .zip金币: 1下载: 0 次发布日期: 2023-11-18
- 语言: Python
- 标签:
资源简介
高效准确的EAST文本检测器的一个TensorFlow实现
代码片段和文件信息
‘‘‘
this file is modified from keras implemention of data process multi-threading
see https://github.com/fchollet/keras/blob/master/keras/utils/data_utils.py
‘‘‘
import time
import numpy as np
import threading
import multiprocessing
try:
import queue
except ImportError:
import Queue as queue
class GeneratorEnqueuer():
“““Builds a queue out of a data generator.
Used in ‘fit_generator‘ ‘evaluate_generator‘ ‘predict_generator‘.
# Arguments
generator: a generator function which endlessly yields data
use_multiprocessing: use multiprocessing if True otherwise threading
wait_time: time to sleep in-between calls to ‘put()‘
random_seed: Initial seed for workers
will be incremented by one for each workers.
“““
def __init__(self generator
use_multiprocessing=False
wait_time=0.05
random_seed=None):
self.wait_time = wait_time
self._generator = generator
self._use_multiprocessing = use_multiprocessing
self._threads = []
self._stop_event = None
self.queue = None
self.random_seed = random_seed
def start(self workers=1 max_queue_size=10):
“““Kicks off threads which add data from the generator into the queue.
# Arguments
workers: number of worker threads
max_queue_size: queue size
(when full threads could block on ‘put()‘)
“““
def data_generator_task():
while not self._stop_event.is_set():
try:
if self._use_multiprocessing or self.queue.qsize() < max_queue_size:
generator_output = next(self._generator)
self.queue.put(generator_output)
else:
time.sleep(self.wait_time)
except Exception:
self._stop_event.set()
raise
try:
if self._use_multiprocessing:
self.queue = multiprocessing.Queue(maxsize=max_queue_size)
self._stop_event = multiprocessing.Event()
else:
self.queue = queue.Queue()
self._stop_event = threading.Event()
for _ in range(workers):
if self._use_multiprocessing:
# Reset random seed else all children processes
# share the same seed
np.random.seed(self.random_seed)
thread = multiprocessing.Process(target=data_generator_task)
thread.daemon = True
if self.random_seed is not None:
self.random_seed += 1
else:
thread = threading.Thread(target=data_generator_task)
self._threads.append(thread)
thread.start()
except:
self.stop()
raise
d
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-08-27 03:10 EAST-master\
文件 1219 2017-08-27 03:10 EAST-master\.gitignore
文件 35141 2017-08-27 03:10 EAST-master\LICENSE
文件 0 2017-08-27 03:10 EAST-master\__init__.py
文件 4280 2017-08-27 03:10 EAST-master\data_util.py
目录 0 2017-08-27 03:10 EAST-master\demo_images\
文件 338376 2017-08-27 03:10 EAST-master\demo_images\img_10.jpg
文件 117772 2017-08-27 03:10 EAST-master\demo_images\img_14.jpg
文件 229940 2017-08-27 03:10 EAST-master\demo_images\img_2.jpg
文件 213424 2017-08-27 03:10 EAST-master\demo_images\img_26.jpg
文件 174745 2017-08-27 03:10 EAST-master\demo_images\img_75.jpg
文件 728640 2017-08-27 03:10 EAST-master\demo_images\web-demo.png
文件 171 2017-08-27 03:10 EAST-master\deploy.sh
文件 7441 2017-08-27 03:10 EAST-master\eval.py
文件 30634 2017-08-27 03:10 EAST-master\icdar.py
目录 0 2017-08-27 03:10 EAST-master\lanms\
文件 11 2017-08-27 03:10 EAST-master\lanms\.gitignore
文件 4397 2017-08-27 03:10 EAST-master\lanms\.ycm_extra_conf.py
文件 365 2017-08-27 03:10 EAST-master\lanms\Makefile
文件 572 2017-08-27 03:10 EAST-master\lanms\__init__.py
文件 245 2017-08-27 03:10 EAST-master\lanms\__main__.py
文件 1596 2017-08-27 03:10 EAST-master\lanms\adaptor.cpp
目录 0 2017-08-27 03:10 EAST-master\lanms\include\
目录 0 2017-08-27 03:10 EAST-master\lanms\include\clipper\
文件 141939 2017-08-27 03:10 EAST-master\lanms\include\clipper\clipper.cpp
文件 15320 2017-08-27 03:10 EAST-master\lanms\include\clipper\clipper.hpp
目录 0 2017-08-27 03:10 EAST-master\lanms\include\pybind11\
文件 18075 2017-08-27 03:10 EAST-master\lanms\include\pybind11\attr.h
文件 4299 2017-08-27 03:10 EAST-master\lanms\include\pybind11\buffer_info.h
文件 87115 2017-08-27 03:10 EAST-master\lanms\include\pybind11\cast.h
文件 6596 2017-08-27 03:10 EAST-master\lanms\include\pybind11\chrono.h
............此处省略37个文件信息
相关资源
- Python-PyTorch对卷积CRF的参考实现
- Python-pytorch实现的人脸检测和人脸识别
- Python-UNet用于医学图像分割的嵌套UN
- Python-TensorFlow弱监督图像分割
- Python-基于tensorflow实现的用textcnn方法
- Python-Keras实现Inceptionv4InceptionResnetv1和
- Python-pytorch中文手册
- Python-FastSCNN的PyTorch实现快速语义分割
- Python-滑动窗口高分辨率显微镜图像分
- Python-使用MovieLens数据集训练的电影推
- Python-机器学习驱动的Web应用程序防火
- Python-subpixel利用Tensorflow的一个子像素
-
Python-汉字的神经风格转移Neuralst
y - Python-神经网络模型能够从音频演讲中
- Python-深度增强学习算法的PyTorch实现策
- Python-基于深度学习的语音增强使用
- Python-基于知识图谱的红楼梦人物关系
- Python-STGAN用于图像合成的空间变换生
- Python-利用GAN进行图片填充
- Python-基于50W携程出行攻略的顺承事件
- Python-在TensorFlow中实现实现图像卷积网
- Python-60DaysRLChallenge中文版强化学习6
- Python-一个非常简单的BiLSTMCRF模型用于
- Python-Tensorflow仿AlphaGo框架实现的AI围棋
- Python-我是小诗姬全唐诗作为训练数据
- Python-用于物体跟踪的全卷积连体网络
- Python-数学建模竞赛中所使用的相关算
- Python-MonoDepthPyTorchPyTorch无监督单目深
- Python-用Tensorflowjs实现的可回收非可回
- Python-利用TensorFlow中的深度学习进行图
评论
共有 条评论