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

Fix problems in Frame Extract from Videos

parent 4fac6d7f
......@@ -2,7 +2,8 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="ff50dbe9-96fb-4654-a170-8d858ba3f6c3" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/src/extraction/feature_extraction.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/extraction/feature_extraction.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/extraction/extractor_frame_video.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/extraction/extractor_frame_video.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/pynovisao.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/pynovisao.py" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
......@@ -13,106 +14,88 @@
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/requeriments.txt">
<entry file="file://$PROJECT_DIR$/src/extraction/extractor_frame_video.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="345">
<caret line="23" selection-start-line="23" selection-end-line="23" />
<state relative-caret-position="416">
<caret line="30" column="10" selection-start-line="30" selection-start-column="10" selection-end-line="30" selection-end-column="10" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/extraction/image_moments.py">
<entry file="file:///usr/lib/python2.7/lib-tk/Tkinter.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="810">
<caret line="60" column="9" selection-start-line="60" selection-start-column="9" selection-end-line="60" selection-end-column="9" />
<folding>
<element signature="e#377#404#0" expanded="true" />
</folding>
<state relative-caret-position="-12384">
<caret line="1826" selection-start-line="1826" selection-end-line="1826" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/interface/tk/tk_canvas.py">
<entry file="file:///usr/lib/python2.7/posixpath.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2445">
<caret line="163" column="21" selection-start-line="163" selection-start-column="21" selection-end-line="163" selection-end-column="21" />
<state relative-caret-position="177">
<caret line="97" selection-start-line="97" selection-end-line="97" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/extraction/extractor_frame_video.py">
<entry file="file:///usr/lib/python2.7/genericpath.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="555">
<caret line="41" column="20" selection-start-line="41" selection-start-column="20" selection-end-line="41" selection-end-column="20" />
<folding>
<element signature="e#504#513#0" expanded="true" />
</folding>
<state relative-caret-position="408">
<caret line="109" selection-start-line="109" selection-end-line="109" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main.py">
<entry file="file://$PROJECT_DIR$/src/extraction/feature_extraction.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="330">
<caret line="26" selection-start-line="26" selection-end-line="26" />
<state relative-caret-position="387">
<caret line="153" column="30" lean-forward="true" selection-start-line="153" selection-start-column="30" selection-end-line="153" selection-end-column="30" />
<folding>
<element signature="e#1043#1058#0" expanded="true" />
<element signature="e#212#221#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/extraction/feature_extraction.py">
<entry file="file://$PROJECT_DIR$/../people-counting-opencv/people_counter.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="472">
<caret line="119" column="24" lean-forward="true" selection-start-line="119" selection-start-column="24" selection-end-line="119" selection-end-column="24" />
<state relative-caret-position="405">
<caret line="48" column="11" selection-start-line="48" selection-start-column="10" selection-end-line="48" selection-end-column="13" />
<folding>
<element signature="e#212#221#0" expanded="true" />
<element signature="e#510#567#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="5310">
<caret line="354" selection-start-line="354" selection-end-line="354" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/INSTALL.sh">
<entry file="file://$PROJECT_DIR$/../people-counting-opencv/pyimagesearch/centroidtracker.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="135">
<caret line="9" selection-start-line="9" selection-end-line="9" selection-end-column="74" />
<state relative-caret-position="60">
<caret line="6" column="38" lean-forward="true" selection-start-line="6" selection-start-column="38" selection-end-line="6" selection-end-column="38" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/pynovisao.py">
<entry file="file://$PROJECT_DIR$/src/classification/weka_classifiers.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="13500">
<caret line="929" column="44" selection-start-line="929" selection-start-column="44" selection-end-line="929" selection-end-column="44" />
<folding>
<element signature="e#202#212#0" expanded="true" />
</folding>
<state relative-caret-position="45">
<caret line="12" column="9" selection-start-line="12" selection-start-column="9" selection-end-line="12" selection-end-column="9" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/classification/weka_classifiers.py">
<entry file="file://$PROJECT_DIR$/src/classification/classifier.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="180">
<caret line="12" column="9" selection-start-line="12" selection-start-column="9" selection-end-line="12" selection-end-column="9" />
<state relative-caret-position="-990">
<caret line="14" column="6" selection-start-line="14" selection-start-column="6" selection-end-line="14" selection-end-column="6" />
</state>
</provider>
</entry>
......@@ -186,14 +169,12 @@
<option value="$PROJECT_DIR$/src/extraction/hog.py" />
<option value="$PROJECT_DIR$/src/extraction/lbp.py" />
<option value="$PROJECT_DIR$/src/extraction/gabor.py" />
<option value="$PROJECT_DIR$/src/extraction/extractor_frame_video.py" />
<option value="$PROJECT_DIR$/requeriments.txt" />
<option value="$PROJECT_DIR$/src/classification/__init__.py" />
<option value="$PROJECT_DIR$/src/util/x11_colors.py" />
<option value="$PROJECT_DIR$/src/interface/tk_interface.py" />
<option value="$PROJECT_DIR$/src/interface/interface.py" />
<option value="$PROJECT_DIR$/src/classification/segnet_keras.py" />
<option value="$PROJECT_DIR$/src/pynovisao.py" />
<option value="$PROJECT_DIR$/src/classification/cnn_keras.py" />
<option value="$PROJECT_DIR$/src/extraction/kcurvature.py" />
<option value="$PROJECT_DIR$/INSTALL_WITH_CONDA.sh" />
......@@ -203,6 +184,10 @@
<option value="$PROJECT_DIR$/src/extraction/image_moments.py" />
<option value="$PROJECT_DIR$/src/interface/tk/tk_canvas.py" />
<option value="$PROJECT_DIR$/src/extraction/feature_extraction.py" />
<option value="$PROJECT_DIR$/src/extraction/extractor_frame_video.py" />
<option value="$PROJECT_DIR$/src/pynovisao.py" />
<option value="$PROJECT_DIR$/../people-counting-opencv/pyimagesearch/centroidtracker.py" />
<option value="$PROJECT_DIR$/../people-counting-opencv/people_counter.py" />
</list>
</option>
</component>
......@@ -221,52 +206,6 @@
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="pynovisao" type="b2602c69:ProjectViewProjectNode" />
<item name="pynovisao" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="pynovisao" type="b2602c69:ProjectViewProjectNode" />
<item name="pynovisao" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="pynovisao" type="b2602c69:ProjectViewProjectNode" />
<item name="pynovisao" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="classification" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="pynovisao" type="b2602c69:ProjectViewProjectNode" />
<item name="pynovisao" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="extraction" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="pynovisao" type="b2602c69:ProjectViewProjectNode" />
<item name="pynovisao" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="interface" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="pynovisao" type="b2602c69:ProjectViewProjectNode" />
<item name="pynovisao" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="interface" type="462c0819:PsiDirectoryNode" />
<item name="tk" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="pynovisao" type="b2602c69:ProjectViewProjectNode" />
<item name="pynovisao" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="segmentation" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="pynovisao" type="b2602c69:ProjectViewProjectNode" />
<item name="pynovisao" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="util" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="pynovisao" type="b2602c69:ProjectViewProjectNode" />
<item name="External Libraries" type="cb654da1:ExternalLibrariesNode" />
......@@ -279,7 +218,7 @@
</component>
<component name="PropertiesComponent">
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../conta-alevinos" />
<property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
</component>
<component name="RecentsManager">
......@@ -407,10 +346,10 @@
<method v="2" />
</configuration>
<list>
<item itemvalue="Python.main" />
<item itemvalue="Python.all_user_input_widgets" />
<item itemvalue="Python.extractor_frame_video" />
<item itemvalue="Python.feature_extraction" />
<item itemvalue="Python.main" />
<item itemvalue="Python.tk_interface" />
</list>
<recent_temporary>
......@@ -427,13 +366,12 @@
</component>
<component name="ToolWindowManager">
<frame x="67" y="25" width="1853" height="1055" extended-state="6" />
<editor active="true" />
<layout>
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.3431694" />
<window_info id="Structure" order="1" weight="0.25" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" weight="0.3292683" />
<window_info anchor="bottom" id="Run" order="2" weight="0.3292683" />
<window_info anchor="bottom" id="Run" order="2" weight="0.32914045" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.3836478" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
......@@ -542,6 +480,11 @@
<line>115</line>
<option name="timeStamp" value="13" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/src/extraction/extractor_frame_video.py</url>
<line>43</line>
<option name="timeStamp" value="15" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
<watches-manager>
......@@ -561,37 +504,6 @@
</expressions>
</component>
<component name="editorHistoryManager">
<entry file="file:///usr/lib/python3.5/tkinter/__init__.py" />
<entry file="file://$USER_HOME$/Downloads/all_user_input_widgets.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="195">
<caret line="15" column="57" selection-start-line="15" selection-start-column="57" selection-end-line="15" selection-end-column="57" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file:///usr/lib/python2.7/lib-tk/Tkconstants.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/src/util/utils.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="495">
<caret line="66" column="11" selection-start-line="66" selection-start-column="11" selection-end-line="66" selection-end-column="11" />
<folding>
<element signature="e#189#199#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/interface/tk/tk_popup.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="240">
<caret line="16" column="28" selection-start-line="16" selection-start-column="28" selection-end-line="16" selection-end-column="28" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/interface/tk/tk_menu.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="570">
......@@ -716,13 +628,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/classification/classifier.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="180">
<caret line="14" column="6" selection-start-line="14" selection-start-column="6" selection-end-line="14" selection-end-column="6" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/interface/tk/tk_logger.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1050">
......@@ -885,16 +790,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/extraction/extractor_frame_video.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="555">
<caret line="41" column="20" selection-start-line="41" selection-start-column="20" selection-end-line="41" selection-end-column="20" />
<folding>
<element signature="e#504#513#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/main.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="330">
......@@ -912,39 +807,91 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/pynovisao.py">
<entry file="file://$PROJECT_DIR$/INSTALL.sh">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="13500">
<caret line="929" column="44" selection-start-line="929" selection-start-column="44" selection-end-line="929" selection-end-column="44" />
<folding>
<element signature="e#202#212#0" expanded="true" />
</folding>
<state relative-caret-position="135">
<caret line="9" selection-start-line="9" selection-end-line="9" selection-end-column="74" />
</state>
</provider>
</entry>
<entry file="file:///usr/lib/python2.7/genericpath.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="408">
<caret line="109" selection-start-line="109" selection-end-line="109" />
</state>
</provider>
</entry>
<entry file="file:///usr/lib/python2.7/posixpath.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="177">
<caret line="97" selection-start-line="97" selection-end-line="97" />
</state>
</provider>
</entry>
<entry file="file:///usr/lib/python2.7/lib-tk/Tkinter.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-12384">
<caret line="1826" selection-start-line="1826" selection-end-line="1826" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/extraction/extractor_frame_video.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="416">
<caret line="30" column="10" selection-start-line="30" selection-start-column="10" selection-end-line="30" selection-end-column="10" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/classification/weka_classifiers.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="180">
<state relative-caret-position="45">
<caret line="12" column="9" selection-start-line="12" selection-start-column="9" selection-end-line="12" selection-end-column="9" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/INSTALL.sh">
<entry file="file://$PROJECT_DIR$/src/classification/classifier.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="135">
<caret line="9" selection-start-line="9" selection-end-line="9" selection-end-column="74" />
<state relative-caret-position="-990">
<caret line="14" column="6" selection-start-line="14" selection-start-column="6" selection-end-line="14" selection-end-column="6" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/pynovisao.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="349">
<caret line="757" column="8" lean-forward="true" selection-start-line="756" selection-start-column="126" selection-end-line="757" selection-end-column="8" />
<folding>
<element signature="e#202#212#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/extraction/feature_extraction.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="472">
<caret line="119" column="24" lean-forward="true" selection-start-line="119" selection-start-column="24" selection-end-line="119" selection-end-column="24" />
<state relative-caret-position="387">
<caret line="153" column="30" lean-forward="true" selection-start-line="153" selection-start-column="30" selection-end-line="153" selection-end-column="30" />
<folding>
<element signature="e#212#221#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../people-counting-opencv/pyimagesearch/centroidtracker.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="60">
<caret line="6" column="38" lean-forward="true" selection-start-line="6" selection-start-column="38" selection-end-line="6" selection-end-column="38" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../people-counting-opencv/people_counter.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="405">
<caret line="48" column="11" selection-start-line="48" selection-start-column="10" selection-end-line="48" selection-end-column="13" />
<folding>
<element signature="e#510#567#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
</project>
\ No newline at end of file
......@@ -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