-
大小: 9.98MB文件類型: .zip金幣: 2下載: 0 次發(fā)布日期: 2023-10-10
- 語(yǔ)言: 其他
- 標(biāo)簽: 深度學(xué)習(xí)??
資源簡(jiǎn)介
deep_sort_yolo3進(jìn)行的多目標(biāo)跟蹤,效果不錯(cuò),在1080ti上可以做到實(shí)時(shí),由于csdn上不能上傳大于220MB的文件,如果有不會(huì)訓(xùn)練模型的朋友,可以私聊我

代碼片段和文件信息
#!?/usr/bin/env?python
“““
Reads?Darknet?config?and?weights?and?creates?Keras?model?with?TF?backend.
“““
import?argparse
import?configparser
import?io
import?os
from?collections?import?defaultdict
import?numpy?as?np
from?keras?import?backend?as?K
from?keras.layers?import?(Conv2D?Input?ZeroPadding2D?Add
??????????????????????????UpSampling2D?Concatenate)
from?keras.layers.advanced_activations?import?LeakyReLU
from?keras.layers.normalization?import?BatchNormalization
from?keras.models?import?Model
from?keras.regularizers?import?l2
from?keras.utils.vis_utils?import?plot_model?as?plot
parser?=?argparse.ArgumentParser(description=‘Darknet?To?Keras?Converter.‘)
parser.add_argument(‘config_path‘?help=‘Path?to?Darknet?cfg?file.‘)
parser.add_argument(‘weights_path‘?help=‘Path?to?Darknet?weights?file.‘)
parser.add_argument(‘output_path‘?help=‘Path?to?output?Keras?model?file.‘)
parser.add_argument(
????‘-p‘
????‘--plot_model‘
????help=‘Plot?generated?Keras?model?and?save?as?image.‘
????action=‘store_true‘)
def?unique_config_sections(config_file):
????“““Convert?all?config?sections?to?have?unique?names.
????Adds?unique?suffixes?to?config?sections?for?compability?with?configparser.
????“““
????section_counters?=?defaultdict(int)
????output_stream?=?io.BytesIO()?#io.StringIO()
????with?open(config_file)?as?fin:
????????for?line?in?fin:
????????????if?line.startswith(‘[‘):
????????????????section?=?line.strip().strip(‘[]‘)
????????????????_section?=?section?+?‘_‘?+?str(section_counters[section])
????????????????section_counters[section]?+=?1
????????????????line?=?line.replace(section?_section)
????????????output_stream.write(line)
????output_stream.seek(0)
????return?output_stream
#?%%
def?_main(args):
????config_path?=?os.path.expanduser(args.config_path)
????weights_path?=?os.path.expanduser(args.weights_path)
????assert?config_path.endswith(‘.cfg‘)?‘{}?is?not?a?.cfg?file‘.format(
????????config_path)
????assert?weights_path.endswith(
????????‘.weights‘)?‘{}?is?not?a?.weights?file‘.format(weights_path)
????output_path?=?os.path.expanduser(args.output_path)
????assert?output_path.endswith(
????????‘.h5‘)?‘output?path?{}?is?not?a?.h5?file‘.format(output_path)
????output_root?=?os.path.splitext(output_path)[0]
????#?Load?weights?and?config.
????print(‘Loading?weights.‘)
????weights_file?=?open(weights_path?‘rb‘)
????major?minor?revision?=?np.ndarray(
????????shape=(3?)?dtype=‘int32‘?buffer=weights_file.read(12))
????if?(major*10+minor)>=2?and?major<1000?and?minor<1000:
????????seen?=?np.ndarray(shape=(1)?dtype=‘int64‘?buffer=weights_file.read(8))
????else:
????????seen?=?np.ndarray(shape=(1)?dtype=‘int32‘?buffer=weights_file.read(4))
????print(‘Weights?Header:?‘?major?minor?revision?seen)
????print(‘Parsing?Darknet?config.‘)
????unique_config_file?=?unique_config_sections(config_path)
????cfg_parser?=?configparser.ConfigParser()
????cfg_parser.read_file(unique_config_file)
????print(‘Creating?Keras?model.‘)
????input_l
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-05-26?06:55??deep_sort_yolov3-master\
?????文件????????1064??2018-05-26?06:55??deep_sort_yolov3-master\LICENSE
?????文件????????1268??2018-05-26?06:55??deep_sort_yolov3-master\README.md
?????文件????????9345??2018-05-26?06:55??deep_sort_yolov3-master\convert.py
?????目錄???????????0??2018-05-26?06:55??deep_sort_yolov3-master\deep_sort\
?????文件??????????27??2018-05-26?06:55??deep_sort_yolov3-master\deep_sort\__init__.py
?????文件?????????146??2018-05-26?06:55??deep_sort_yolov3-master\deep_sort\__init__.pyc
?????文件????????1433??2018-05-26?06:55??deep_sort_yolov3-master\deep_sort\detection.py
?????文件????????2125??2018-05-26?06:55??deep_sort_yolov3-master\deep_sort\detection.pyc
?????文件????????2830??2018-05-26?06:55??deep_sort_yolov3-master\deep_sort\iou_matching.py
?????文件????????3196??2018-05-26?06:55??deep_sort_yolov3-master\deep_sort\iou_matching.pyc
?????文件????????7787??2018-05-26?06:55??deep_sort_yolov3-master\deep_sort\kalman_filter.py
?????文件????????7571??2018-05-26?06:55??deep_sort_yolov3-master\deep_sort\kalman_filter.pyc
?????文件????????7786??2018-05-26?06:55??deep_sort_yolov3-master\deep_sort\linear_assignment.py
?????文件????????7396??2018-05-26?06:55??deep_sort_yolov3-master\deep_sort\linear_assignment.pyc
?????文件????????5470??2018-05-26?06:55??deep_sort_yolov3-master\deep_sort\nn_matching.py
?????文件????????6865??2018-05-26?06:55??deep_sort_yolov3-master\deep_sort\nn_matching.pyc
?????文件????????1914??2018-05-26?06:55??deep_sort_yolov3-master\deep_sort\preprocessing.py
?????文件????????2176??2018-05-26?06:55??deep_sort_yolov3-master\deep_sort\preprocessing.pyc
?????文件????????4976??2018-05-26?06:55??deep_sort_yolov3-master\deep_sort\track.py
?????文件????????6200??2018-05-26?06:55??deep_sort_yolov3-master\deep_sort\track.pyc
?????文件????????5291??2018-05-26?06:55??deep_sort_yolov3-master\deep_sort\tracker.py
?????文件????????5275??2018-05-26?06:55??deep_sort_yolov3-master\deep_sort\tracker.pyc
?????文件????????3601??2018-05-26?06:55??deep_sort_yolov3-master\demo.py
?????目錄???????????0??2018-05-26?06:55??deep_sort_yolov3-master\model_data\
?????文件?????????625??2018-05-26?06:55??deep_sort_yolov3-master\model_data\coco_classes.txt
?????文件????11244410??2018-05-26?06:55??deep_sort_yolov3-master\model_data\mars-small128.pb
?????文件?????????135??2018-05-26?06:55??deep_sort_yolov3-master\model_data\voc_classes.txt
?????文件??????????76??2018-05-26?06:55??deep_sort_yolov3-master\model_data\yolo_anchors.txt
?????目錄???????????0??2018-05-26?06:55??deep_sort_yolov3-master\tools\
?????文件???????????0??2018-05-26?06:55??deep_sort_yolov3-master\tools\__init__.py
............此處省略14個(gè)文件信息
評(píng)論
共有 條評(píng)論