Commit f2276820 authored by Diego André Sant'Ana's avatar Diego André Sant'Ana 🤞

Alter problems in code because python version

parent d5869921
......@@ -264,7 +264,6 @@ class FeatureExtractor(object):
arff.write(bytes(str("%s %s %s\n" % ('@attribute', label, t)), 'utf-8'))
arff.write(bytes(str("%s %s {%s}\n\n" % ('@attribute', 'classe', ', '.join(classes))), 'utf-8'))
arff.write(bytes(str('@data\n\n'), 'utf-8'))
for instance in data:
......@@ -17,7 +17,7 @@ from util.utils import ImageUtils
from skimage.measure import regionprops, moments, moments_central
from skimage.morphology import label
import numpy as np
from extractor import Extractor
from .extractor import Extractor
import math
class RawCentralMoments(Extractor):
......@@ -83,7 +83,7 @@ class HuMoments(Extractor):
image : opencv image
Image to be analyzed.
mage to be analyzed.
features : tuple
......@@ -566,7 +566,7 @@ class Act(object):
print("Wait to complete processes all images!")
with tqdm(total=len(list_segments)) as pppbar:
for idx_segment in list_segments:
segment, size_segment, idx_segment = self.segmenter.get_segment(self, idx_segment=idx_segment)[:-1]
segment, size_segment,xml_file, idx_segment = self.segmenter.get_segment(self, idx_segment=idx_segment)[:-1]
# 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
......@@ -16,7 +16,7 @@ from skimage.util import img_as_float, img_as_ubyte
from util.config import Config
from util.utils import TimeUtils
from util.x11_colors import X11Colors
from pascal_voc_writer import Writer as wr
from abc import ABCMeta, abstractmethod
class SkimageSegmenter(object):
......@@ -118,6 +118,7 @@ class SkimageSegmenter(object):
# Get the rectangle that encompasses the countour
x,y,w,h = cv2.boundingRect(max_contour)
# Create the object for this segment in the .XML file
if xml_file is not None:
xml_file.addObject(name_segment, x, y, x+w, y+h)
segment = segment[y:y+h, x:x+w]
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