Commit 2789b389 authored by Everton Castelão Tetila's avatar Everton Castelão Tetila 💬

correção da imagens excluidas da pasta demo.

parent 70591df1
......@@ -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 ).
......
......@@ -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.
......
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