代码拉取完成,页面将自动刷新
同步操作将从 MSNH/keras-yolo3-detection 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/usr/bin/env python
# -- coding: utf-8 --
"""
Copyright (c) 2019. All rights reserved.
Created by C. L. Wang on 2019/1/3
"""
from project_utils import *
from root_dir import ROOT_DIR
from yolo3_predict import YOLO
def generate_data(file_name):
print('执行开始')
out_file = os.path.join(ROOT_DIR, 'dataset', file_name)
create_file(out_file)
up_folder = os.path.abspath(os.path.join(ROOT_DIR, '..'))
data_folder = os.path.join(up_folder, 'data_set', 'XX-Images-57w-416')
path_list, name_list = traverse_dir_files(data_folder)
yolo = YOLO()
for count, (path, name) in enumerate(zip(path_list, name_list)):
# print(path, name)
try:
objects_line = yolo.detect_objects_of_image(path)
except Exception as e:
print("错误: {}".format(name))
continue
if not objects_line:
continue
# print(objects_line)
print("已处理: {}".format(name))
data_line = '{}---{}'.format(name, objects_line)
write_line_utf8(out_file, data_line)
if count % 1000 == 0:
print('count: {}'.format(count))
# break
yolo.close_session()
print('执行结束')
if __name__ == '__main__':
file_name = 'dataset_57w_objects.txt'
generate_data(file_name)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。