资源简介
基于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程序
- OpenCV-Python入门教程.pdf
- 《编写高质量代码:改善Python程序的
- 鱼c工作室小甲鱼零基础学python全套课
- 快速入门python培训教程.ppt
- Python-即时通讯Python实现web版多人聊天
- 逻辑回归Python源代码
- micropython中文教程嵌入式详细教程
- python写的一个爬取指定电影链接
- python游戏编程入门--高清版
- 小甲鱼 Python3 完整ppt
- 学生成绩管理系统-python-tkinker.zip
- pywin32-221.win-amd64-py3.7.rar
- python 高效开发实战源代码配套
- Python语言程序设计国家计算机等级考
- FlaskWeb开发:基于Python的Web应用开发实
- Python Graphics.pdf
- python3.6模块集合-piprequestssetuptoolspyg
- 最新东北大学Python程序设计实验2019
- 深度学习入门:基于Python的理论与实
- Python爬虫爬取智联招聘
- 100行Python代码实现自动抢火车票
- 《Learning data mining with python》中文版
- Python基础教程(第3版).pdf109608
- Deep_Learning_for_Computer_Vision_with_Python_
- python3.4的安装包
- 利用脉冲耦合神经网络的图像处理.
- Python基础教程(第3版).[挪]Magnus Li
- 极客Python之Git实用教程-Github教程
- vamei-从Python开始学编程.pdf
评论
共有 条评论