文档服务地址:http://47.92.0.57:3000/ 周报索引地址:http://47.92.0.57:3000/s/NruNXRYmV

Commit a59e70b3 by 王肇一

version 1.0 ready to merge

parent dedd9c69
......@@ -98,3 +98,4 @@ optional arguments:
|v0.2|1.更新了滤波算法<br>2.修改了一些小bug<br>3.对部分函数进行解耦|
|v0.3|1.训练了Unet模型<br>2.增加了部分命令行工具<br>4.重新设计目录结构|
|v0.4|更新了mask计算方法,避免将信号计算为背景|
|v1.0|完善第一阶段任务|
\ No newline at end of file
......@@ -20,12 +20,9 @@ from utils.predict import predict_img
from resCalc import save_img, get_subarea_info
def divide_list(list, process_num):
res = []
step = math.ceil(len(list) / process_num)
for i in range(0, len(list), step):
res.append(list[i:i + step])
return res
def divide_list(list, step):
n = math.ceil(len(list)/step)
return [list[i:i + n] for i in range(0, len(list), n)]
def step_1(net, args, device, list, position):
......@@ -91,7 +88,7 @@ if __name__ == '__main__':
path = [(y, x) for y in filter(lambda x: x != '.DS_Store', os.listdir('data/imgs')) for x in filter(
lambda x: x.endswith('.tif') and not x.endswith('dc.tif') and not x.endswith('DC.tif') and not x.endswith(
'dc .tif'), os.listdir('data/imgs/' + y))]
seperate_path = divide_list(path, args.process)
seperate_path = divide_list(path,args.process)
if args.step == 1:
net = UNet(n_channels = 1, n_classes = 1)
......@@ -110,7 +107,7 @@ if __name__ == '__main__':
elif args.step == 2:
dir = [x for x in filter(lambda x: x != '.DS_Store', os.listdir('data/imgs/'))]
sep_dir = divide_list(dir, args.process)
sep_dir = divide_list(dir,args.process)
pool = Pool(args.process)
for i, list in enumerate(sep_dir):
......
......@@ -5,3 +5,5 @@ matplotlib
numpy
opencv-python
seaborn
torch
torchvision
\ No newline at end of file
......@@ -11,7 +11,7 @@ import re
def save_img(img_list, dir, name):
num = len(img_list)
plt.figure(figsize = (100, 20))
plt.figure(dpi = 300)
plt.suptitle(name)
for i, title in zip(range(num), img_list):
......
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