Mercurial > repos > perssond > coreograph
comparison UNet2DtCycifTRAINCoreograph.py @ 1:57f1260ca94e draft
"planemo upload commit fec9dc76b3dd17b14b02c2f04be9d30f71eba1ae"
| author | watsocam |
|---|---|
| date | Fri, 11 Mar 2022 23:40:51 +0000 |
| parents | 99308601eaa6 |
| children |
comparison
equal
deleted
inserted
replaced
| 0:99308601eaa6 | 1:57f1260ca94e |
|---|---|
| 522 # UNet2D.train(imPath,logPath,modelPath,pmPath,500,100,40,True,20000,1,0) | 522 # UNet2D.train(imPath,logPath,modelPath,pmPath,500,100,40,True,20000,1,0) |
| 523 UNet2D.setup(128, 1, 2, 20, 2, 2, 3, 2, 0.03, 4, 32) | 523 UNet2D.setup(128, 1, 2, 20, 2, 2, 3, 2, 0.03, 4, 32) |
| 524 UNet2D.train(imPath, logPath, modelPath, pmPath, 2053, 513 , 641, True, 10, 1, 1) | 524 UNet2D.train(imPath, logPath, modelPath, pmPath, 2053, 513 , 641, True, 10, 1, 1) |
| 525 UNet2D.deploy(imPath,100,modelPath,pmPath,1,1) | 525 UNet2D.deploy(imPath,100,modelPath,pmPath,1,1) |
| 526 | 526 |
| 527 # I = im2double(tifread('/home/mc457/files/CellBiology/IDAC/Marcelo/Etc/UNetTestSets/SinemSaka_NucleiSegmentation_SingleImageInferenceTest3.tif')) | 527 |
| 528 # UNet2D.singleImageInferenceSetup(modelPath,0) | 528 |
| 529 # J = UNet2D.singleImageInference(I,'accumulate',0) | 529 |
| 530 # UNet2D.singleImageInferenceCleanup() | |
| 531 # # imshowlist([I,J]) | |
| 532 # # sys.exit(0) | |
| 533 # # tifwrite(np.uint8(255*I),'/home/mc457/Workspace/I1.tif') | |
| 534 # # tifwrite(np.uint8(255*J),'/home/mc457/Workspace/I2.tif') | |
| 535 # K = np.zeros((2,I.shape[0],I.shape[1])) | |
| 536 # K[0,:,:] = I | |
| 537 # K[1,:,:] = J | |
| 538 # tifwrite(np.uint8(255*K),'/home/mc457/Workspace/Sinem_NucSeg.tif') | |
| 539 | |
| 540 # UNet2D.singleImageInferenceSetup(modelPath,0) | |
| 541 # imagePath = 'Y://sorger//data//RareCyte//Connor//Topacio_P2_AF//ashlar//C0078' | |
| 542 # | |
| 543 # fileList = glob.glob(imagePath + '//registration//C0078.ome.tif') | |
| 544 # print(fileList) | |
| 545 # for iFile in fileList: | |
| 546 # fileName = os.path.basename(iFile) | |
| 547 # fileNamePrefix = fileName.split(os.extsep, 1) | |
| 548 # I = im2double(tifffile.imread(iFile, key=0)) | |
| 549 # hsize = int((float(I.shape[0])*float(0.75))) | |
| 550 # vsize = int((float(I.shape[1])*float(0.75))) | |
| 551 # I = resize(I,(hsize,vsize)) | |
| 552 # J = UNet2D.singleImageInference(I,'accumulate',1) | |
| 553 # K = np.zeros((3,I.shape[0],I.shape[1])) | |
| 554 # K[2,:,:] = I | |
| 555 # K[0,:,:] = J | |
| 556 # J = UNet2D.singleImageInference(I, 'accumulate', 2) | |
| 557 # K[1, :, :] = J | |
| 558 # outputPath = imagePath + '//prob_maps' | |
| 559 # if not os.path.exists(outputPath): | |
| 560 # os.makedirs(outputPath) | |
| 561 # tifwrite(np.uint8(255*K),outputPath + '//' + fileNamePrefix[0] +'_NucSeg.tif') | |
| 562 # UNet2D.singleImageInferenceCleanup() | |
| 563 | |
| 564 | |
| 565 # ----- test 2 ----- | |
| 566 | |
| 567 # imPath = '/home/mc457/files/CellBiology/IDAC/Marcelo/Etc/UNetTestSets/ClarenceYapp_NucleiSegmentation' | |
| 568 # UNet2D.setup(128,1,2,8,2,2,3,1,0.1,3,4) | |
| 569 # UNet2D.train(imPath,logPath,modelPath,pmPath,800,100,100,False,10,1) | |
| 570 # UNet2D.deploy(imPath,100,modelPath,pmPath,1) | |
| 571 | |
| 572 | |
| 573 # ----- test 3 ----- | |
| 574 | |
| 575 # imPath = '/home/mc457/files/CellBiology/IDAC/Marcelo/Etc/UNetTestSets/CarmanLi_CellTypeSegmentation' | |
| 576 # # UNet2D.setup(256,1,2,8,2,2,3,1,0.1,3,4) | |
| 577 # # UNet2D.train(imPath,logPath,modelPath,pmPath,1400,100,164,False,10000,1) | |
| 578 # UNet2D.deploy(imPath,164,modelPath,pmPath,1) | |
| 579 | |
| 580 | |
| 581 # ----- test 4 ----- | |
| 582 | |
| 583 # imPath = '/home/cicconet/Downloads/TrainSet1' | |
| 584 # UNet2D.setup(64,1,2,8,2,2,3,1,0.1,3,4) | |
| 585 # UNet2D.train(imPath,logPath,modelPath,pmPath,200,8,8,False,2000,1,0) | |
| 586 # # UNet2D.deploy(imPath,164,modelPath,pmPath,1) |
