Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
inovisao
pynovisao
Commits
8390e5c3
Commit
8390e5c3
authored
May 11, 2018
by
Geazy Menezes
Browse files
menu item place changed
parent
6f925869
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
6 deletions
+11
-6
src/classification/cnn_keras.py
src/classification/cnn_keras.py
+1
-1
src/main.py
src/main.py
+2
-1
src/pynovisao.py
src/pynovisao.py
+8
-4
No files found.
src/classification/cnn_keras.py
View file @
8390e5c3
...
...
@@ -524,7 +524,7 @@ class CNNKeras(Classifier):
return
train_generator
,
validation_generator
,
test_generator
def
single_classify
(
self
,
image_path
,
directory
,
extractors
,
dict_classes
):
from
matplotlib
.
pylab
im
imread
from
matplotlib.pylab
im
port
imread
image
=
imread
(
image_path
)
predict
=
self
.
model
.
predict
([
image
])[
0
]
return
dict_classes
[
predict
]
\ No newline at end of file
src/main.py
View file @
8390e5c3
...
...
@@ -89,11 +89,12 @@ if __name__ == "__main__":
tk
.
add_command
(
"Load h5 weight (only for CNNs)"
,
act
.
open_weight
)
tk
.
add_command
(
"Execute"
,
act
.
run_classifier
,
'C'
)
tk
.
add_command
(
"Execute folder"
,
act
.
run_classifier_folder
)
tk
.
add_command
(
"Execute Graphical Confusion Matrix"
,
act
.
run_grafic_confusion_matrix
)
tk
.
add_menu
(
"Experimenter"
)
tk
.
add_check_button
(
"Ground Truth"
,
act
.
toggle_ground_truth
,
default_state
=
False
)
tk
.
add_separator
()
tk
.
add_command
(
"Execute Graphical Confusion Matrix"
,
act
.
run_grafic_confusion_matrix
)
tk
.
add_separator
()
tk
.
add_command
(
"Cross Validation"
,
act
.
cross_validation
,
'X'
)
tk
.
add_command
(
"Experimenter All"
,
act
.
experimenter_all
,
'p'
)
...
...
src/pynovisao.py
View file @
8390e5c3
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
"""
This file must contain the implementation code for all actions of pynovisao.
...
...
@@ -465,7 +463,7 @@ class Act(object):
def
process_config
():
"""Update the current classifier."""
new_config
=
self
.
tk
.
get_config_and_destroy
()
self
.
classifier
=
[
new_config
[
classifier
].
meta
for
classifier
in
new_config
if
new_config
[
classifier
].
value
==
True
][
0
]()
...
...
@@ -946,8 +944,14 @@ class Act(object):
def
run_grafic_confusion_matrix
(
self
):
'''
Generate a a graphical confusion matrix where images are classified and according to classification go to the wrong or right folder.
'''
from
classification
import
WekaClassifiers
if
not
isinstance
(
self
.
classifier
,
WekaClassifiers
):
message
=
'Only available to Weka Classifiers.'
IException
(
message
)
if
not
self
.
has_trained
:
message
=
'Dataset Must Be Trained.'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment