资源简介
基于tensorflow深度学习框架,采用python语言编写代码,实现基于深度学习的目标检测程序

代码片段和文件信息
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License Version 2.0 (the “License“);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing software
# distributed under the License is distributed on an “AS IS“ BASIS
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
r“““Convert raw PASCAL dataset to TFRecord for object_detection.
Example usage:
./create_pascal_tf_record --data_dir=/home/user/VOCdevkit \
--year=VOC2012 \
--output_path=/home/user/pascal.record
“““
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import hashlib
import io
import logging
import os
from lxml import etree
import PIL.Image
import tensorflow as tf
from object_detection.utils import dataset_util
from object_detection.utils import label_map_util
flags = tf.app.flags
flags.DEFINE_string(‘data_dir‘ ‘‘ ‘Root directory to raw PASCAL VOC dataset.‘)
flags.DEFINE_string(‘set‘ ‘train‘ ‘Convert training set validation set or ‘
‘merged set.‘)
flags.DEFINE_string(‘annotations_dir‘ ‘Annotations‘
‘(Relative) path to annotations directory.‘)
flags.DEFINE_string(‘year‘ ‘VOC2007‘ ‘Desired challenge year.‘)
flags.DEFINE_string(‘output_path‘ ‘‘ ‘Path to output TFRecord‘)
flags.DEFINE_string(‘label_map_path‘ ‘data/pascal_label_map.pbtxt‘
‘Path to label map proto‘)
flags.DEFINE_boolean(‘ignore_difficult_instances‘ False ‘Whether to ignore ‘
‘difficult instances‘)
FLAGS = flags.FLAGS
SETS = [‘train‘ ‘val‘ ‘trainval‘ ‘test‘]
YEARS = [‘VOC2007‘ ‘VOC2012‘ ‘merged‘]
def dict_to_tf_example(data
dataset_directory
label_map_dict
ignore_difficult_instances=False
image_subdirectory=‘JPEGImages‘):
“““Convert xml derived dict to tf.Example proto.
Notice that this function normalizes the bounding box coordinates provided
by the raw data.
Args:
data: dict holding PASCAL xml fields for a single image (obtained by
running dataset_util.recursive_parse_xml_to_dict)
dataset_directory: Path to root directory holding PASCAL dataset
label_map_dict: A map from string label names to integers ids.
ignore_difficult_instances: Whether to skip difficult instances in the
dataset (default: False).
image_subdirectory: String specifying subdirectory within the
PASCAL dataset directory holding the actual image data.
Returns:
example: The converted tf.Example.
Raises:
V
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-07-22 02:35 chapter_5\
文件 3475 2018-07-22 02:35 chapter_5\README.md
目录 0 2018-07-22 02:35 chapter_5\research\
目录 0 2018-07-22 02:35 chapter_5\research\slim\
文件 20014 2018-07-22 02:35 chapter_5\research\slim\train_image_classifier.py
文件 46294 2018-07-22 02:35 chapter_5\research\slim\slim_walkthrough.ipynb
文件 231 2018-07-22 02:35 chapter_5\research\slim\setup.py
文件 1397 2018-07-22 02:35 chapter_5\research\slim\export_inference_graph_test.py
文件 4658 2018-07-22 02:35 chapter_5\research\slim\export_inference_graph.py
文件 6666 2018-07-22 02:35 chapter_5\research\slim\eval_image_classifier.py
文件 2306 2018-07-22 02:35 chapter_5\research\slim\download_and_convert_data.py
文件 0 2018-07-22 02:35 chapter_5\research\slim\__init__.py
文件 0 2018-07-22 02:35 chapter_5\research\slim\WORKSPACE
文件 24026 2018-07-22 02:35 chapter_5\research\slim\README.md
文件 9842 2018-07-22 02:35 chapter_5\research\slim\BUILD
目录 0 2018-07-22 02:35 chapter_5\research\ob
文件 6550 2018-07-22 02:35 chapter_5\research\ob
文件 12592 2018-07-22 02:35 chapter_5\research\ob
文件 7307 2018-07-22 02:35 chapter_5\research\ob
文件 9358 2018-07-22 02:35 chapter_5\research\ob
文件 25563 2018-07-22 02:35 chapter_5\research\ob
文件 15091 2018-07-22 02:35 chapter_5\research\ob
文件 4488 2018-07-22 02:35 chapter_5\research\ob
文件 9119 2018-07-22 02:35 chapter_5\research\ob
文件 24890 2018-07-22 02:35 chapter_5\research\ob
文件 6044 2018-07-22 02:35 chapter_5\research\ob
文件 7838 2018-07-22 02:35 chapter_5\research\ob
文件 3952 2018-07-22 02:35 chapter_5\research\ob
文件 7019 2018-07-22 02:35 chapter_5\research\ob
文件 0 2018-07-22 02:35 chapter_5\research\ob
文件 4517 2018-07-22 02:35 chapter_5\research\ob
............此处省略303个文件信息
- 上一篇:OpenCV-Python入门教程.pdf
- 下一篇:图像处理的详细python程序
相关资源
- 二级考试python试题12套(包括选择题和
- pywin32_python3.6_64位
- python+ selenium教程
- PycURL(Windows7/Win32)Python2.7安装包 P
- 英文原版-Scientific Computing with Python
- 7.图像风格迁移 基于深度学习 pyt
- 基于Python的学生管理系统
- A Byte of Python(简明Python教程)(第
- Python实例174946
- Python 人脸识别
- Python 人事管理系统
- 基于python-flask的个人博客系统
- 计算机视觉应用开发流程
- python 调用sftp断点续传文件
- python socket游戏
- 基于Python爬虫爬取天气预报信息
- python函数编程和讲解
- Python开发的个人博客
- 基于python的三层神经网络模型搭建
- python实现自动操作windows应用
- python人脸识别(opencv)
- python 绘图(方形、线条、圆形)
- python疫情卡UN管控
- python 连连看小游戏源码
- 基于PyQt5的视频播放器设计
- 一个简单的python爬虫
- csv文件行列转换python实现代码
- Python操作Mysql教程手册
- Python Machine Learning Case Studies
- python获取硬件信息
评论
共有 条评论