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

add test

parent 9d443b13
import os import xlrd
from multiprocessing import Process import cv2
from threading import Thread from three_color import handle_from_url
from webcam import img_to_three_color_map
def main(): def read_excel():
rs = os.walk('../../fashionbase/images/dataset_0520/weiyi') data = xlrd.open_workbook('20190522上衣测试.xlsx')
for a, b, c in rs: table = data.sheets()[0]
for i in c[:100]: nrows = table.nrows
source_path = '../../fashionbase/images/dataset_0520/weiyi/' + i for i in range(nrows):
target_path = 'output/' + i url = table.row_values(i)[1]
print(source_path) path = url.split('/')[-1]
print(target_path) path = path.split('-')[0]
img_to_three_color_map(source_path, target_path) print(path)
#p = Process(target=img_to_three_color_map, args=[source_path, target_path]) img = handle_from_url(url)
#p.start() cv2.imwrite('/test/' + path, img)
if __name__ == '__main__': if __name__ == '__main__':
main() read_excel()
...@@ -61,8 +61,6 @@ def img_to_three_color_map(source_path, target_path): ...@@ -61,8 +61,6 @@ def img_to_three_color_map(source_path, target_path):
masks_per_dim=args.masks_per_dim, masks_per_dim=args.masks_per_dim,
min_image_size=args.min_image_size, min_image_size=args.min_image_size,
) )
source_path = source_path[3:]
target_path = target_path[3:]
print(target_path) print(target_path)
print(source_path) print(source_path)
img = cv2.imread(source_path) img = cv2.imread(source_path)
......
import sys
sys.path.append("..")
import os import os
from proj.tasks import img_reproce from proj.tasks import img_reproce
...@@ -24,8 +27,8 @@ def main(): ...@@ -24,8 +27,8 @@ def main():
source_path = '../../fashionbase/images/dataset_0520/xifu/' + file source_path = '../../fashionbase/images/dataset_0520/xifu/' + file
target_path = source_path.replace('dataset_0520', 'dataset_0520_10000') target_path = source_path.replace('dataset_0520', 'dataset_0520_10000')
# source_path = source_path[3:] source_path = source_path[3:]
# target_path = target_path[3:] target_path = target_path[3:]
print(source_path) print(source_path)
print(target_path) print(target_path)
# img_reproce.delay(source_path, target_path) # img_reproce.delay(source_path, target_path)
......
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