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
44a93341
Commit
44a93341
authored
Sep 15, 2020
by
Diego André Sant'Ana
🤞
Browse files
upload dataset
parent
c2e01b6c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
src/classification/cnn_keras.py
src/classification/cnn_keras.py
+6
-2
src/pynovisao.py
src/pynovisao.py
+1
-1
src/segmentation/skimage_segmenter.py
src/segmentation/skimage_segmenter.py
+1
-1
No files found.
src/classification/cnn_keras.py
View file @
44a93341
...
...
@@ -234,13 +234,17 @@ class CNNKeras(Classifier):
path_classes
=
self
.
weight_path
.
replace
(
"_model.h5"
,
"_classes.npy"
)
print
(
"Load Model H5:"
+
self
.
weight_path
)
np_load_old
=
np
.
load
# modify the default parameters of np.load
np
.
load
=
lambda
*
a
,
**
k
:
np_load_old
(
*
a
,
allow_pickle
=
True
,
**
k
)
CLASS_NAMES
=
np
.
load
(
path_classes
).
item
().
keys
()
except
Exception
as
e
:
raise
IException
(
"Can't load the model in "
+
self
.
weight_path
+
str
(
e
))
str
(
e
))
output_classification
=
self
.
model
.
predict_generator
(
classify_generator
,
classify_generator
.
samples
,
verbose
=
2
)
classify_generator
)
one_hot_output
=
np
.
argmax
(
output_classification
,
axis
=
1
)
...
...
src/pynovisao.py
View file @
44a93341
...
...
@@ -843,7 +843,7 @@ class Act(object):
if
idx_segment
%
10
==
0
:
self
.
tk
.
write_log
(
"Saving %d of %d"
,
(
idx_segment
+
1
),
qtd_superpixel
)
segment
,
size_segment
,
idx_segment
,
run_time
=
self
.
segmenter
.
get_segment
(
idx_segment
=
idx_segment
)
segment
,
size_segment
,
xml
,
idx_segment
,
run_time
=
self
.
segmenter
.
get_segment
(
idx_segment
=
idx_segment
)
filepath
=
File
.
save_class_image
(
segment
,
self
.
dataset
,
self
.
classes
[
idx_class
][
"name"
].
value
,
self
.
_image_name
,
idx_segment
)
if
filepath
:
self
.
tk
.
append_log
(
"
\n
Segment saved in %s"
,
filepath
)
...
...
src/segmentation/skimage_segmenter.py
View file @
44a93341
...
...
@@ -178,7 +178,7 @@ class SkimageSegmenter(object):
if
SkimageSegmenter
.
FORCE_OPT
==
False
:
colored_image
=
cv2
.
addWeighted
(
self
.
_original_image
,
0.7
,
class_color
,
0.3
,
0
)
else
:
colored_image
=
cv2
.
addWeighted
(
image
,
0.
7
,
class_color
,
0.
3
,
0
)
colored_image
=
cv2
.
addWeighted
(
image
,
0.
1
,
class_color
,
0.
9
,
0
)
colored_image
=
cv2
.
bitwise_and
(
colored_image
,
colored_image
,
mask
=
mask_segment
)
# Create a new image keeping the painting only in pixels inside of segments
...
...
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