Commit d795fdb9 authored by 吴升宇's avatar 吴升宇

do test img

parent 152d2753
......@@ -308,12 +308,12 @@ class COCODemo(object):
a, b, c = img.shape
for x in range(a):
for y in range(b):
if img[x, y].tolist() < [5, 5, 5]:
if img[x, y].tolist() == [0, 0, 0]:
break
img[x, y] = [0, 0, 0]
for y in range(b - 1, 0, -1):
if img[x, y].tolist() < [5, 5, 5]:
if img[x, y].tolist() == [0, 0, 0]:
break
img[x, y] = [0, 0, 0]
......
......@@ -19,18 +19,18 @@ def main():
path = '/data/images/dataset_0523/'
rs = os.walk(path)
for a, b, files in rs:
print(a)
for file in files[:5000]:
dir = a.replace('dataset_0523', 'dataset_0523_first')
fold = os.path.exists(dir)
if not fold:
os.mkdir(dir)
source_path = a + file
target_path = dir + file
print(source_path)
print(target_path)
#write_redis(source_path, target_path)
if b == []:
for file in files[:5000]:
dir = a.replace('dataset_0523', 'dataset_0523_first')
fold = os.path.exists(dir)
if not fold:
os.mkdir(dir)
source_path = a + file
target_path = dir + file
print(source_path)
print(target_path)
#write_redis(source_path, target_path)
if __name__ == '__main__':
......
......@@ -7,13 +7,15 @@ def read_excel():
data = xlrd.open_workbook('20190522上衣测试.xlsx')
table = data.sheets()[0]
nrows = table.nrows
for i in range(nrows):
for i in range(1, nrows+1):
url = table.row_values(i)[1]
tag = table.row_values(i)[2]
path = url.split('/')[-1]
path = path.split('-')[0]
path = tag + '_' + path
print(path)
img = handle_from_url(url)
cv2.imwrite('/test/' + path, img)
cv2.imwrite('tem/' + path, img)
if __name__ == '__main__':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment