代码拉取完成,页面将自动刷新
import cv2
import numpy as np
import os
from shutil import copyfile
from sys import exit
train_txt = "../data/ImageSets/train.txt"
trainval_txt = "../data/ImageSets/trainval.txt"
test_txt = "../data/ImageSets/test.txt"
val_txt = "../data/ImageSets/val.txt"
dir_txt = "model/ship_gt/labels/"
# save_dir_ = "model/ship_gt/labels_test/"
save_dir_ = "model/ship_gt/labels_train/"
source_dir = "model/ship_gt/labels_int/"
name_list = []
# with open(test_txt, 'r') as fr:
with open(train_txt, 'r') as fr:
for line in fr.readlines():
name_list.append(line.split('\n')[0])
source = '{}{}.txt'.format(source_dir,line.split('\n')[0])
target = '{}{}.txt'.format(save_dir_,line.split('\n')[0])
try:
copyfile(source, target)
except IOError as e:
print("Unable to copy file. %s" % e)
exit(1)
except:
print("Unexpected error:", sys.exc_info())
exit(1)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。