Commit 81813530 authored by Diego André Sant'Ana's avatar Diego André Sant'Ana 🤞
Browse files

message of finish in XML conversion

parent 92dc5bf9
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -1207,21 +1207,35 @@ class Act(object):
pathIO: string
Filepath to the Original Images folder.
'''
processor_amd=False
arquivos = [] #Segments alredy found, starts empty
thread = [] #Threads created, starts empty.
#Verifies all original images (files) under the given folder (pathIO)
for pog, _, files in os.walk(os.path.abspath(pathIO)):
#Creates threads with one file each.
for file in files:
if(file.endswith('.jpeg') or file.endswith('.tif') or file.endswith('.jpg') or file.endswith('.png')):##(-f)
t=th.Thread(target = achaSeg, args=(self, pathS, file, pog, arquivos))
thread.append(t)
if processor_amd==True :
t = multiprocessing.Process(target = achaSeg, args=(self, pathS, file, pog, arquivos))
thread.append(t)
else:
t = th.Thread(target = achaSeg, args=(self, pathS, file, pog, arquivos))
thread.append(t)
for td in thread:
#Starts thread, and halts further thread iniciation until a safe RAM level is achieved.
ramused=psutil.virtual_memory()[1]/1000000000
td.start()
if(ramused <= 1.5): #Joins current threads should current free RAM levels be under 1.5Gb.
td.join()
self.tk.write_log("Waiting for workers to finish annotation of superpixels!")
with tqdm(total=len(thread)) as ppbar:
for t in thread:
t.join()
ppbar.update(1)
ppbar.close()
print("The process was completed with "+str(len(thread))+"!")
self.tk.write_log("The process was completed with "+str(len(thread))+"!")
achaImg(self, self._seg_folder,self._img_folder) #Starts the process of identification of segments in files
def config_xml(self): #Configures the directories for Segments and Original Images.
......
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