Commit 19829b45 authored by Diego André Sant'Ana's avatar Diego André Sant'Ana 🤞

Fix problems in Frame Extract from Videos

parent 4fac6d7f
This diff is collapsed.
......@@ -28,7 +28,7 @@ import threading
#
#from util.utils import TimeUtils
from util.utils import TimeUtils
......@@ -40,15 +40,16 @@ class ExtractFM(object):
pass
#Method Run, you can passa tkParent to manipulate objet to tk parent, this code use to console to print process extract frame movies.
def run(self,tkParent):
self.tk=tkParent
self.folder_a=None
self.folder_b=None
#window
self.window = Tk()
self.window.mainloop()
self.window = Toplevel()
self.window.title("Extract frames from videos")
self.window.attributes('-zoomed', False)
self.window.geometry("450x250+300+300")
self.window.geometry("450x275+300+300")
self.frame = Frame(self.window )
self.frame.pack(fill=X, expand=False)
#find a folder with videos
......@@ -67,24 +68,23 @@ class ExtractFM(object):
self.label_b =Label(self.frame, text="Folder no selected", padx=5, pady=5)
self.label_b.pack(padx=5, pady=5, expand=True, fill=X)
self.label_c =Label(self.frame, text="Enter in how many frames a frame will be extracted ", padx=5, pady=5)
self.label_c =Label(self.frame, text="Each of the N frames draws a frame ", padx=5, pady=5)
self.label_c.pack(padx=5, pady=5, expand=True, fill=X)
#number de frame by extract one picture
self.val_frame=IntVar()
self.val_frame.set(1)
self.val_frame.set(30)
self.spinbox = Spinbox(self.frame, from_=1.0, to=100.0)
self.spinbox = Spinbox(self.frame, from_=1.0, to=100.0, textvariable=self.val_frame)
self.spinbox.configure(activebackground="#f9f9f9")
self.spinbox.configure(background="white")
self.spinbox.configure(buttonbackground="wheat")
self.spinbox.configure(disabledforeground="#b8a786")
self.spinbox.configure(from_="1.0")
self.spinbox.configure(highlightbackground="black")
self.spinbox.configure(selectbackground="#c4c4c4")
self.spinbox.configure(textvariable=self.val_frame)
self.spinbox.configure(to="100.0")
self.spinbox.pack(padx=5, pady=5, expand=True, fill=X)
#ToolTip(self.spinbox , "Select between 1 an 100 to extract frame each the number selected!Example: Select 30 to extract 1 frame each 30 fps!")
......@@ -140,7 +140,7 @@ class ExtractFM(object):
self.tk.write_log("Init process:"+ str(listaArquivo))
lista_thread=[]
#start_time = TimeUtils.get_time()
start_time = TimeUtils.get_time()
for r, d, f in os.walk(dir):
for file in f:
......@@ -155,7 +155,7 @@ class ExtractFM(object):
t.join()
#end_time = TimeUtils.get_time()
end_time = TimeUtils.get_time()
self.tk.append_log("Finish process:"+str(end_time - start_time))
def select_folder_source(self):
......
......@@ -562,7 +562,7 @@ class Act(object):
pppbar.update(1)
pppbar.close()
gc.collect()
# Perform the feature extraction of all segments in image ( not applied to ConvNets ).
if self.classifier.must_extract_features():
self.tk.append_log("Running extractors on test images... (%0.3f seconds)", (TimeUtils.get_time() - start_time))
......@@ -624,6 +624,7 @@ class Act(object):
self.tk.append_log("\nClassification finished")
self.tk.append_log("Time elapsed: %0.3f seconds", (end_time - start_time))
gc.collect()
def run_training(self):
start_time = TimeUtils.get_time()
......
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