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
2789b389
Commit
2789b389
authored
Sep 18, 2018
by
Everton Castelão Tetila
💬
Browse files
correção da imagens excluidas da pasta demo.
parent
70591df1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
src/pynovisao.py
src/pynovisao.py
+2
-1
src/util/file_utils.py
src/util/file_utils.py
+27
-0
No files found.
src/pynovisao.py
View file @
2789b389
...
...
@@ -543,7 +543,8 @@ class Act(object):
for
idx_segment
in
list_segments
:
segment
,
size_segment
,
idx_segment
=
self
.
segmenter
.
get_segment
(
self
,
idx_segment
=
idx_segment
)[:
-
1
]
filepath
=
File
.
save_class_image
(
segment
,
self
.
dataset
,
tmp
,
self
.
_image_name
,
idx_segment
)
# Problem here! Dataset removed.
filepath
=
File
.
save_only_class_image
(
segment
,
self
.
dataset
,
tmp
,
self
.
_image_name
,
idx_segment
)
len_segments
[
idx_segment
]
=
size_segment
# Perform the feature extraction of all segments in image ( not applied to ConvNets ).
...
...
src/util/file_utils.py
View file @
2789b389
...
...
@@ -177,6 +177,33 @@ class File(object):
return
File
.
save_image
(
image
,
File
.
make_path
(
dataset
,
directory
),
filename
+
'_%05d'
%
idx
,
ext
)
@
staticmethod
def
save_only_class_image
(
image
,
dataset
,
directory
,
filename
,
idx
,
ext
=
'.tif'
):
"""Save a class image only.
Parameters
----------
image : opencv image
Image to be saved.
dataset : string
Path do image dataset.
directory : string
Directory where image must be saved.
image : string
Name of image.
image : string
Name of image.
idx : integer
Index of image inside the class.
ext : string, optional, default = '.tif'
Extension which image must be saved in format .ext.
Returns
-------
filepath : string
Return the complete filepath where image was saved.
"""
return
File
.
save_image
(
image
,
File
.
make_path
(
dataset
,
directory
),
filename
+
'_%05d'
%
idx
,
ext
)
@
staticmethod
def
list_dirs
(
dataset
):
"""List all directories inside the dataset.
...
...
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