-
大小: 4.05MB文件類型: .zip金幣: 2下載: 0 次發(fā)布日期: 2023-10-11
- 語言: Python
- 標(biāo)簽: 深度學(xué)習(xí)??目標(biāo)檢測(cè)??python??tensor??
資源簡(jiǎn)介
基于tensorflow深度學(xué)習(xí)框架,采用python語言編寫代碼,實(shí)現(xiàn)基于深度學(xué)習(xí)的目標(biāo)檢測(cè)程序

代碼片段和文件信息
#?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(‘a(chǎn)nnotations_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
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????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個(gè)文件信息
評(píng)論
共有 條評(píng)論